chore: auto deref
This commit is contained in:
parent
8ee501e4d9
commit
a3ce137500
@ -261,7 +261,7 @@ impl Engine {
|
|||||||
let func = match cache.entry(hash) {
|
let func = match cache.entry(hash) {
|
||||||
Entry::Vacant(entry) => {
|
Entry::Vacant(entry) => {
|
||||||
let func = if args.len() == 2 {
|
let func = if args.len() == 2 {
|
||||||
get_builtin_binary_op_fn(&name, operands[0], operands[1])
|
get_builtin_binary_op_fn(name, operands[0], operands[1])
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
@ -253,7 +253,7 @@ impl<'a> Target<'a> {
|
|||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn source(&self) -> &Dynamic {
|
pub fn source(&self) -> &Dynamic {
|
||||||
match self {
|
match self {
|
||||||
Self::RefMut(r) => *r,
|
Self::RefMut(r) => r,
|
||||||
#[cfg(not(feature = "no_closure"))]
|
#[cfg(not(feature = "no_closure"))]
|
||||||
Self::SharedValue { source, .. } => source,
|
Self::SharedValue { source, .. } => source,
|
||||||
Self::TempValue(v) => v,
|
Self::TempValue(v) => v,
|
||||||
@ -401,9 +401,9 @@ impl Deref for Target<'_> {
|
|||||||
#[inline]
|
#[inline]
|
||||||
fn deref(&self) -> &Dynamic {
|
fn deref(&self) -> &Dynamic {
|
||||||
match self {
|
match self {
|
||||||
Self::RefMut(r) => *r,
|
Self::RefMut(r) => r,
|
||||||
#[cfg(not(feature = "no_closure"))]
|
#[cfg(not(feature = "no_closure"))]
|
||||||
Self::SharedValue { source, .. } => &**source,
|
Self::SharedValue { source, .. } => source,
|
||||||
Self::TempValue(ref r) => r,
|
Self::TempValue(ref r) => r,
|
||||||
#[cfg(not(feature = "no_index"))]
|
#[cfg(not(feature = "no_index"))]
|
||||||
Self::Bit { ref value, .. }
|
Self::Bit { ref value, .. }
|
||||||
@ -425,7 +425,7 @@ impl DerefMut for Target<'_> {
|
|||||||
#[inline]
|
#[inline]
|
||||||
fn deref_mut(&mut self) -> &mut Dynamic {
|
fn deref_mut(&mut self) -> &mut Dynamic {
|
||||||
match self {
|
match self {
|
||||||
Self::RefMut(r) => *r,
|
Self::RefMut(r) => r,
|
||||||
#[cfg(not(feature = "no_closure"))]
|
#[cfg(not(feature = "no_closure"))]
|
||||||
Self::SharedValue { source, .. } => &mut *source,
|
Self::SharedValue { source, .. } => &mut *source,
|
||||||
Self::TempValue(ref mut r) => r,
|
Self::TempValue(ref mut r) => r,
|
||||||
|
Loading…
Reference in New Issue
Block a user