diff options
author | Maan2003 <[email protected]> | 2021-06-13 04:54:16 +0100 |
---|---|---|
committer | Maan2003 <[email protected]> | 2021-06-13 04:54:16 +0100 |
commit | c9b4ac5be4daaabc062ab1ee663eba8594750003 (patch) | |
tree | 6090c8c38c735875c916255920525cf5fff45c75 /crates/ide/src/hover.rs | |
parent | d6737e55fb49d286b5e646f57975b27b2c95ce92 (diff) |
clippy::redudant_borrow
Diffstat (limited to 'crates/ide/src/hover.rs')
-rw-r--r-- | crates/ide/src/hover.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs index 1c6d36939..b4b3b45b5 100644 --- a/crates/ide/src/hover.rs +++ b/crates/ide/src/hover.rs | |||
@@ -288,7 +288,7 @@ fn runnable_action( | |||
288 | ) -> Option<HoverAction> { | 288 | ) -> Option<HoverAction> { |
289 | match def { | 289 | match def { |
290 | Definition::ModuleDef(it) => match it { | 290 | Definition::ModuleDef(it) => match it { |
291 | ModuleDef::Module(it) => runnable_mod(&sema, it).map(|it| HoverAction::Runnable(it)), | 291 | ModuleDef::Module(it) => runnable_mod(sema, it).map(|it| HoverAction::Runnable(it)), |
292 | ModuleDef::Function(func) => { | 292 | ModuleDef::Function(func) => { |
293 | let src = func.source(sema.db)?; | 293 | let src = func.source(sema.db)?; |
294 | if src.file_id != file_id.into() { | 294 | if src.file_id != file_id.into() { |
@@ -297,7 +297,7 @@ fn runnable_action( | |||
297 | return None; | 297 | return None; |
298 | } | 298 | } |
299 | 299 | ||
300 | runnable_fn(&sema, func).map(HoverAction::Runnable) | 300 | runnable_fn(sema, func).map(HoverAction::Runnable) |
301 | } | 301 | } |
302 | _ => None, | 302 | _ => None, |
303 | }, | 303 | }, |
@@ -432,7 +432,7 @@ fn hover_for_definition( | |||
432 | return match def { | 432 | return match def { |
433 | Definition::Macro(it) => match &it.source(db)?.value { | 433 | Definition::Macro(it) => match &it.source(db)?.value { |
434 | Either::Left(mac) => { | 434 | Either::Left(mac) => { |
435 | let label = macro_label(&mac); | 435 | let label = macro_label(mac); |
436 | from_def_source_labeled(db, it, Some(label), mod_path) | 436 | from_def_source_labeled(db, it, Some(label), mod_path) |
437 | } | 437 | } |
438 | Either::Right(_) => { | 438 | Either::Right(_) => { |
@@ -516,7 +516,7 @@ fn hover_for_keyword( | |||
516 | if !token.kind().is_keyword() { | 516 | if !token.kind().is_keyword() { |
517 | return None; | 517 | return None; |
518 | } | 518 | } |
519 | let famous_defs = FamousDefs(&sema, sema.scope(&token.parent()?).krate()); | 519 | let famous_defs = FamousDefs(sema, sema.scope(&token.parent()?).krate()); |
520 | // std exposes {}_keyword modules with docstrings on the root to document keywords | 520 | // std exposes {}_keyword modules with docstrings on the root to document keywords |
521 | let keyword_mod = format!("{}_keyword", token.text()); | 521 | let keyword_mod = format!("{}_keyword", token.text()); |
522 | let doc_owner = find_std_module(&famous_defs, &keyword_mod)?; | 522 | let doc_owner = find_std_module(&famous_defs, &keyword_mod)?; |