From c9b4ac5be4daaabc062ab1ee663eba8594750003 Mon Sep 17 00:00:00 2001 From: Maan2003 Date: Sun, 13 Jun 2021 09:24:16 +0530 Subject: clippy::redudant_borrow --- crates/hir_expand/src/builtin_macro.rs | 6 +++--- crates/hir_expand/src/input.rs | 2 +- crates/hir_expand/src/proc_macro.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/hir_expand/src') diff --git a/crates/hir_expand/src/builtin_macro.rs b/crates/hir_expand/src/builtin_macro.rs index 0b310ba2f..51572226e 100644 --- a/crates/hir_expand/src/builtin_macro.rs +++ b/crates/hir_expand/src/builtin_macro.rs @@ -354,7 +354,7 @@ fn concat_expand( // concat works with string and char literals, so remove any quotes. // It also works with integer, float and boolean literals, so just use the rest // as-is. - let component = unquote_str(&it).unwrap_or_else(|| it.text.to_string()); + let component = unquote_str(it).unwrap_or_else(|| it.text.to_string()); text.push_str(&component); } // handle boolean literals @@ -417,7 +417,7 @@ fn parse_string(tt: &tt::Subtree) -> Result { tt.token_trees .get(0) .and_then(|tt| match tt { - tt::TokenTree::Leaf(tt::Leaf::Literal(it)) => unquote_str(&it), + tt::TokenTree::Leaf(tt::Leaf::Literal(it)) => unquote_str(it), _ => None, }) .ok_or_else(|| mbe::ExpandError::ConversionError) @@ -561,7 +561,7 @@ mod tests { use syntax::ast::NameOwner; fn expand_builtin_macro(ra_fixture: &str) -> String { - let (db, file_id) = TestDB::with_single_file(&ra_fixture); + let (db, file_id) = TestDB::with_single_file(ra_fixture); let parsed = db.parse(file_id); let mut macro_rules: Vec<_> = parsed.syntax_node().descendants().filter_map(ast::MacroRules::cast).collect(); diff --git a/crates/hir_expand/src/input.rs b/crates/hir_expand/src/input.rs index 82dc7f326..bc3ecc593 100644 --- a/crates/hir_expand/src/input.rs +++ b/crates/hir_expand/src/input.rs @@ -78,7 +78,7 @@ mod tests { use super::*; fn test_remove_derives_up_to(attr: usize, ra_fixture: &str, expect: Expect) { - let (db, file_id) = TestDB::with_single_file(&ra_fixture); + let (db, file_id) = TestDB::with_single_file(ra_fixture); let parsed = db.parse(file_id); let mut items: Vec<_> = diff --git a/crates/hir_expand/src/proc_macro.rs b/crates/hir_expand/src/proc_macro.rs index dbe1b446e..3ad2d3bf7 100644 --- a/crates/hir_expand/src/proc_macro.rs +++ b/crates/hir_expand/src/proc_macro.rs @@ -51,7 +51,7 @@ impl ProcMacroExpander { // Proc macros have access to the environment variables of the invoking crate. let env = &krate_graph[calling_crate].env; - proc_macro.expander.expand(&tt, attr_arg, &env).map_err(mbe::ExpandError::from) + proc_macro.expander.expand(tt, attr_arg, env).map_err(mbe::ExpandError::from) } None => Err(mbe::ExpandError::UnresolvedProcMacro), } -- cgit v1.2.3