Avoid allocation in ChainItemKind::is_tup_field_access
This commit is contained in:
parent
06e16449d2
commit
1a70f40d7f
@ -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,
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user