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/ide/src/syntax_highlighting/highlight.rs | 4 ++-- crates/ide/src/syntax_highlighting/html.rs | 2 +- crates/ide/src/syntax_highlighting/inject.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/ide/src/syntax_highlighting') diff --git a/crates/ide/src/syntax_highlighting/highlight.rs b/crates/ide/src/syntax_highlighting/highlight.rs index 84012227d..8c0e553c0 100644 --- a/crates/ide/src/syntax_highlighting/highlight.rs +++ b/crates/ide/src/syntax_highlighting/highlight.rs @@ -449,12 +449,12 @@ fn highlight_method_call( krate: Option, method_call: &ast::MethodCallExpr, ) -> Option { - let func = sema.resolve_method_call(&method_call)?; + let func = sema.resolve_method_call(method_call)?; let mut h = SymbolKind::Function.into(); h |= HlMod::Associated; - if func.is_unsafe(sema.db) || sema.is_unsafe_method_call(&method_call) { + if func.is_unsafe(sema.db) || sema.is_unsafe_method_call(method_call) { h |= HlMod::Unsafe; } if func.is_async(sema.db) { diff --git a/crates/ide/src/syntax_highlighting/html.rs b/crates/ide/src/syntax_highlighting/html.rs index 5327af845..478facfee 100644 --- a/crates/ide/src/syntax_highlighting/html.rs +++ b/crates/ide/src/syntax_highlighting/html.rs @@ -23,7 +23,7 @@ pub(crate) fn highlight_as_html(db: &RootDatabase, file_id: FileId, rainbow: boo let hl_ranges = highlight(db, file_id, None, false); let text = parse.tree().syntax().to_string(); let mut buf = String::new(); - buf.push_str(&STYLE); + buf.push_str(STYLE); buf.push_str("
");
     for r in &hl_ranges {
         let chunk = html_escape(&text[r.range]);
diff --git a/crates/ide/src/syntax_highlighting/inject.rs b/crates/ide/src/syntax_highlighting/inject.rs
index 4269d339e..883252c0e 100644
--- a/crates/ide/src/syntax_highlighting/inject.rs
+++ b/crates/ide/src/syntax_highlighting/inject.rs
@@ -23,7 +23,7 @@ pub(super) fn ra_fixture(
     literal: ast::String,
     expanded: SyntaxToken,
 ) -> Option<()> {
-    let active_parameter = ActiveParameter::at_token(&sema, expanded)?;
+    let active_parameter = ActiveParameter::at_token(sema, expanded)?;
     if !active_parameter.ident().map_or(false, |name| name.text().starts_with("ra_fixture")) {
         return None;
     }
@@ -124,7 +124,7 @@ pub(super) fn doc_comment(
     }
 
     for attr in attributes.by_key("doc").attrs() {
-        let InFile { file_id, value: src } = attrs_source_map.source_of(&attr);
+        let InFile { file_id, value: src } = attrs_source_map.source_of(attr);
         if file_id != node.file_id {
             continue;
         }
-- 
cgit v1.2.3