From 3fb3bf7f9190d6bb5786b9eadabb517bdbcd7c54 Mon Sep 17 00:00:00 2001 From: Alek Ratzloff Date: Tue, 1 Oct 2024 09:31:27 -0700 Subject: [PATCH] Squash dead code warning for Method::self_binding Signed-off-by: Alek Ratzloff --- src/obj/function.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/obj/function.rs b/src/obj/function.rs index 85cf1e1..2db9f22 100644 --- a/src/obj/function.rs +++ b/src/obj/function.rs @@ -282,7 +282,7 @@ impl Debug for Method { write!( fmt, "", - self.self_binding.borrow().ty_name(), + self.self_binding().borrow().ty_name(), function_name, self.function.borrow().arity().unwrap(), self as *const _ as usize @@ -299,7 +299,7 @@ impl Object for Method { fn call(&self, vm: &mut Vm, mut argc: Argc) { let self_pos = vm.stack().len() - (argc as usize); - vm.stack_mut().insert(self_pos, self.self_binding.clone()); + vm.stack_mut().insert(self_pos, self.self_binding().clone()); argc += 1; self.function.borrow().call(vm, argc) @@ -307,7 +307,7 @@ impl Object for Method { fn equals(&self, other: &dyn Object) -> bool { if let Some(other) = other.as_any().downcast_ref::() { - ptr::addr_eq(&*self.self_binding, &*other.self_binding) + ptr::addr_eq(&*self.self_binding(), &*other.self_binding()) && ptr::addr_eq(&*self.function, &*other.function) } else { false