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
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue