replaced some Strings with SmolStr

This commit is contained in:
Moritz Gmeiner 2024-09-03 16:56:22 +02:00
commit 947949601f
4 changed files with 10 additions and 11 deletions

View file

@ -215,7 +215,7 @@ impl Eval for Expr {
let method = method_expr.eval(env)?;
if let Value::Function(ref fun) = method {
let name = fun.name().into();
let name = fun.name().clone();
methods.insert(name, method);
}
}
@ -322,7 +322,7 @@ pub fn call_fun(fun: Rc<LoxFunction>, env: &mut Environment) -> EvalResult<Value
env.enter_scope()?;
env.define(fun.name(), Value::Function(Rc::clone(&fun)));
env.define(fun.name().clone(), Value::Function(Rc::clone(&fun)));
env.insert_closure(fun.closure().clone());