Skip to content

Commit 1a70f40

Browse files
Mattias Wallinytmimi
Mattias Wallin
authored andcommitted
Avoid allocation in ChainItemKind::is_tup_field_access
1 parent 06e1644 commit 1a70f40

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/chains.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ impl ChainItemKind {
209209
fn is_tup_field_access(expr: &ast::Expr) -> bool {
210210
match expr.kind {
211211
ast::ExprKind::Field(_, ref field) => {
212-
field.name.to_string().chars().all(|c| c.is_digit(10))
212+
field.name.as_str().chars().all(|c| c.is_digit(10))
213213
}
214214
_ => false,
215215
}

0 commit comments

Comments
 (0)