Skip to content

Commit

Permalink
Avoid allocation in ChainItemKind::is_tup_field_access
Browse files Browse the repository at this point in the history
  • Loading branch information
Mattias Wallin authored and Rawk committed Sep 2, 2024
1 parent 40909b4 commit e85870e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/chains.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down

0 comments on commit e85870e

Please sign in to comment.