feat(value): less clone
This commit is contained in:
@@ -50,7 +50,7 @@ pub struct Func<'vm> {
|
||||
}
|
||||
|
||||
impl<'vm> Func<'vm> {
|
||||
pub fn call(self, vm: &'vm VM<'_>, arg: Value<'vm>) -> Result<Value<'vm>> {
|
||||
pub fn call(&self, vm: &'vm VM<'_>, arg: Value<'vm>) -> Result<Value<'vm>> {
|
||||
use Param::*;
|
||||
|
||||
let env = Rc::new(self.env.as_ref().clone());
|
||||
@@ -78,7 +78,7 @@ impl<'vm> Func<'vm> {
|
||||
let formal = formal.clone().into();
|
||||
let arg = arg
|
||||
.select(formal)
|
||||
.or_else(|| default.map(|idx| Value::Thunk(Thunk::new(vm.get_thunk(idx)))))
|
||||
.or_else(|| default.map(|idx| Value::Thunk(Thunk::new(vm.get_thunk(idx)).into())))
|
||||
.unwrap();
|
||||
new.insert_mut(formal, arg);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user