mirror of
https://github.com/MorizzG/rlox.git
synced 2025-12-06 04:12:42 +00:00
replaced some Strings with SmolStr
This commit is contained in:
parent
943528a0db
commit
947949601f
4 changed files with 10 additions and 11 deletions
|
|
@ -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());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue