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

@ -29,7 +29,7 @@ impl LoxClass {
// if class has an init method: insert an implicit "return this;" at its end
if let Some(Value::Function(init)) = methods.get("init") {
let name = init.name().to_owned();
let name = init.name().clone();
let closure = init.closure().clone();
let param_names = init.param_names().to_vec();
let mut body = init.body().clone();
@ -74,7 +74,7 @@ impl LoxClass {
self.superclass.clone()
}
pub fn name(&self) -> &str {
pub fn name(&self) -> &SmolStr {
&self.name
}