aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/syntax_highlighting
diff options
context:
space:
mode:
authorMaan2003 <[email protected]>2021-06-13 04:54:16 +0100
committerMaan2003 <[email protected]>2021-06-13 04:54:16 +0100
commitc9b4ac5be4daaabc062ab1ee663eba8594750003 (patch)
tree6090c8c38c735875c916255920525cf5fff45c75 /crates/ide/src/syntax_highlighting
parentd6737e55fb49d286b5e646f57975b27b2c95ce92 (diff)
clippy::redudant_borrow
Diffstat (limited to 'crates/ide/src/syntax_highlighting')
-rw-r--r--crates/ide/src/syntax_highlighting/highlight.rs4
-rw-r--r--crates/ide/src/syntax_highlighting/html.rs2
-rw-r--r--crates/ide/src/syntax_highlighting/inject.rs4
3 files changed, 5 insertions, 5 deletions
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(
449 krate: Option<hir::Crate>, 449 krate: Option<hir::Crate>,
450 method_call: &ast::MethodCallExpr, 450 method_call: &ast::MethodCallExpr,
451) -> Option<Highlight> { 451) -> Option<Highlight> {
452 let func = sema.resolve_method_call(&method_call)?; 452 let func = sema.resolve_method_call(method_call)?;
453 453
454 let mut h = SymbolKind::Function.into(); 454 let mut h = SymbolKind::Function.into();
455 h |= HlMod::Associated; 455 h |= HlMod::Associated;
456 456
457 if func.is_unsafe(sema.db) || sema.is_unsafe_method_call(&method_call) { 457 if func.is_unsafe(sema.db) || sema.is_unsafe_method_call(method_call) {
458 h |= HlMod::Unsafe; 458 h |= HlMod::Unsafe;
459 } 459 }
460 if func.is_async(sema.db) { 460 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
23 let hl_ranges = highlight(db, file_id, None, false); 23 let hl_ranges = highlight(db, file_id, None, false);
24 let text = parse.tree().syntax().to_string(); 24 let text = parse.tree().syntax().to_string();
25 let mut buf = String::new(); 25 let mut buf = String::new();
26 buf.push_str(&STYLE); 26 buf.push_str(STYLE);
27 buf.push_str("<pre><code>"); 27 buf.push_str("<pre><code>");
28 for r in &hl_ranges { 28 for r in &hl_ranges {
29 let chunk = html_escape(&text[r.range]); 29 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(
23 literal: ast::String, 23 literal: ast::String,
24 expanded: SyntaxToken, 24 expanded: SyntaxToken,
25) -> Option<()> { 25) -> Option<()> {
26 let active_parameter = ActiveParameter::at_token(&sema, expanded)?; 26 let active_parameter = ActiveParameter::at_token(sema, expanded)?;
27 if !active_parameter.ident().map_or(false, |name| name.text().starts_with("ra_fixture")) { 27 if !active_parameter.ident().map_or(false, |name| name.text().starts_with("ra_fixture")) {
28 return None; 28 return None;
29 } 29 }
@@ -124,7 +124,7 @@ pub(super) fn doc_comment(
124 } 124 }
125 125
126 for attr in attributes.by_key("doc").attrs() { 126 for attr in attributes.by_key("doc").attrs() {
127 let InFile { file_id, value: src } = attrs_source_map.source_of(&attr); 127 let InFile { file_id, value: src } = attrs_source_map.source_of(attr);
128 if file_id != node.file_id { 128 if file_id != node.file_id {
129 continue; 129 continue;
130 } 130 }