Use CompactString for Identifier (#12101)

This commit is contained in:
Micha Reiser 2024-07-01 10:06:02 +02:00 committed by GitHub
parent db6ee74cbe
commit 5109b50bb3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
474 changed files with 4953 additions and 4776 deletions

View file

@ -1,3 +1,4 @@
use ruff_python_ast::name::Name;
use ruff_python_ast::{self as ast, Expr, ExprContext, Number, Operator, Pattern, Singleton};
use ruff_text_size::{Ranged, TextSize};
@ -510,7 +511,7 @@ impl<'src> Parser<'src> {
);
let invalid_node = Expr::Name(ast::ExprName {
range: self.missing_node_range(),
id: String::new(),
id: Name::empty(),
ctx: ExprContext::Invalid,
});
Pattern::MatchValue(ast::PatternMatchValue {
@ -616,7 +617,7 @@ impl<'src> Parser<'src> {
} else {
Box::new(Expr::Name(ast::ExprName {
range: ident.range(),
id: String::new(),
id: Name::empty(),
ctx: ExprContext::Invalid,
}))
}
@ -667,7 +668,7 @@ impl<'src> Parser<'src> {
&pattern,
);
ast::Identifier {
id: String::new(),
id: Name::empty(),
range: parser.missing_node_range(),
}
};