From 26a1675764c9f96cc96d75d2129dd6c828b8df51 Mon Sep 17 00:00:00 2001 From: Jeremy Kolb Date: Sat, 12 Dec 2020 12:27:09 -0500 Subject: Remove some redundant allocations --- crates/syntax/src/ast/node_ext.rs | 2 +- crates/syntax/src/ast/token_ext.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/syntax/src/ast') diff --git a/crates/syntax/src/ast/node_ext.rs b/crates/syntax/src/ast/node_ext.rs index aa3a4b606..820af2d20 100644 --- a/crates/syntax/src/ast/node_ext.rs +++ b/crates/syntax/src/ast/node_ext.rs @@ -55,7 +55,7 @@ impl ast::Attr { let key = self.simple_name()?; let value_token = lit.syntax().first_token()?; - let value: SmolStr = ast::String::cast(value_token.clone())?.value()?.into(); + let value: SmolStr = ast::String::cast(value_token)?.value()?.into(); Some((key, value)) } diff --git a/crates/syntax/src/ast/token_ext.rs b/crates/syntax/src/ast/token_ext.rs index 52b7285dd..5e9620a40 100644 --- a/crates/syntax/src/ast/token_ext.rs +++ b/crates/syntax/src/ast/token_ext.rs @@ -599,7 +599,7 @@ impl ast::IntNumber { text = &text[radix.prefix_len()..]; let buf; - if text.contains("_") { + if text.contains('_') { buf = text.replace('_', ""); text = buf.as_str(); }; -- cgit v1.2.3