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 ytmimi committed Sep 3, 2024
1 parent 06e1644 commit 1a70f40
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 1a70f40

Please sign in to comment.