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 5d30ce6 commit bb0a368
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 bb0a368

Please sign in to comment.