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