replaced Box<str> with SmolStr

This commit is contained in:
Moritz Gmeiner 2024-09-02 05:19:30 +02:00
commit da6a820638
21 changed files with 137 additions and 85 deletions

View file

@ -3,6 +3,7 @@ use std::rc::Rc;
use rlox2_frontend::lexer::LexerError;
use rlox2_frontend::parser::{BinaryOp, ParserError, UnaryOp};
use smol_str::SmolStr;
use thiserror::Error;
use crate::Value;
@ -45,7 +46,7 @@ pub enum RuntimeError {
#[error("only objects have attributes")]
InvalidSetTarget,
#[error("class {0} has no property {name}", class.name())]
UndefinedAttribute { class: Rc<LoxClass>, name: Box<str> },
UndefinedAttribute { class: Rc<LoxClass>, name: SmolStr },
#[error("{value} is not a valid superclass")]
InvalidSuperclass { value: Value },
#[error("stack overflow")]