Avoid allocation in ChainItemKind::is_tup_field_access

This commit is contained in:
Mattias Wallin 2024-09-01 13:13:14 +02:00 committed by Yacin Tmimi
parent 06e16449d2
commit 1a70f40d7f

View File

@ -209,7 +209,7 @@ impl ChainItemKind {
fn is_tup_field_access(expr: &ast::Expr) -> bool {
match expr.kind {
ast::ExprKind::Field(_, ref field) => {
field.name.to_string().chars().all(|c| c.is_digit(10))
field.name.as_str().chars().all(|c| c.is_digit(10))
}
_ => false,
}