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/rust-analyzer/src/handlers.rs | |
parent | d6737e55fb49d286b5e646f57975b27b2c95ce92 (diff) |
clippy::redudant_borrow
Diffstat (limited to 'crates/rust-analyzer/src/handlers.rs')
-rw-r--r-- | crates/rust-analyzer/src/handlers.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/rust-analyzer/src/handlers.rs b/crates/rust-analyzer/src/handlers.rs index 40dd0da3e..59339d401 100644 --- a/crates/rust-analyzer/src/handlers.rs +++ b/crates/rust-analyzer/src/handlers.rs | |||
@@ -1396,7 +1396,7 @@ pub(crate) fn handle_semantic_tokens_full_delta( | |||
1396 | 1396 | ||
1397 | if let Some(prev_id) = &cached_tokens.result_id { | 1397 | if let Some(prev_id) = &cached_tokens.result_id { |
1398 | if *prev_id == params.previous_result_id { | 1398 | if *prev_id == params.previous_result_id { |
1399 | let delta = to_proto::semantic_token_delta(&cached_tokens, &semantic_tokens); | 1399 | let delta = to_proto::semantic_token_delta(cached_tokens, &semantic_tokens); |
1400 | *cached_tokens = semantic_tokens; | 1400 | *cached_tokens = semantic_tokens; |
1401 | return Ok(Some(delta.into())); | 1401 | return Ok(Some(delta.into())); |
1402 | } | 1402 | } |
@@ -1540,7 +1540,7 @@ fn runnable_action_links( | |||
1540 | snap: &GlobalStateSnapshot, | 1540 | snap: &GlobalStateSnapshot, |
1541 | runnable: Runnable, | 1541 | runnable: Runnable, |
1542 | ) -> Option<lsp_ext::CommandLinkGroup> { | 1542 | ) -> Option<lsp_ext::CommandLinkGroup> { |
1543 | let cargo_spec = CargoTargetSpec::for_file(&snap, runnable.nav.file_id).ok()?; | 1543 | let cargo_spec = CargoTargetSpec::for_file(snap, runnable.nav.file_id).ok()?; |
1544 | let hover_config = snap.config.hover(); | 1544 | let hover_config = snap.config.hover(); |
1545 | if !hover_config.runnable() || should_skip_target(&runnable, cargo_spec.as_ref()) { | 1545 | if !hover_config.runnable() || should_skip_target(&runnable, cargo_spec.as_ref()) { |
1546 | return None; | 1546 | return None; |
@@ -1624,7 +1624,7 @@ fn run_rustfmt( | |||
1624 | text_document: TextDocumentIdentifier, | 1624 | text_document: TextDocumentIdentifier, |
1625 | range: Option<lsp_types::Range>, | 1625 | range: Option<lsp_types::Range>, |
1626 | ) -> Result<Option<Vec<lsp_types::TextEdit>>> { | 1626 | ) -> Result<Option<Vec<lsp_types::TextEdit>>> { |
1627 | let file_id = from_proto::file_id(&snap, &text_document.uri)?; | 1627 | let file_id = from_proto::file_id(snap, &text_document.uri)?; |
1628 | let file = snap.analysis.file_text(file_id)?; | 1628 | let file = snap.analysis.file_text(file_id)?; |
1629 | let crate_ids = snap.analysis.crate_for(file_id)?; | 1629 | let crate_ids = snap.analysis.crate_for(file_id)?; |
1630 | 1630 | ||
@@ -1671,7 +1671,7 @@ fn run_rustfmt( | |||
1671 | .into()); | 1671 | .into()); |
1672 | } | 1672 | } |
1673 | 1673 | ||
1674 | let frange = from_proto::file_range(&snap, text_document, range)?; | 1674 | let frange = from_proto::file_range(snap, text_document, range)?; |
1675 | let start_line = line_index.index.line_col(frange.range.start()).line; | 1675 | let start_line = line_index.index.line_col(frange.range.start()).line; |
1676 | let end_line = line_index.index.line_col(frange.range.end()).line; | 1676 | let end_line = line_index.index.line_col(frange.range.end()).line; |
1677 | 1677 | ||