Squash dead code warning for Method::self_binding

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2024-10-01 09:31:27 -07:00
parent 80448899d8
commit 3fb3bf7f91

View File

@@ -282,7 +282,7 @@ impl Debug for Method {
write!(
fmt,
"<Method {}.{}/{} at {}>",
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::<Method>() {
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