Squash dead code warning for Method::self_binding
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user