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/to_proto.rs | |
parent | d6737e55fb49d286b5e646f57975b27b2c95ce92 (diff) |
clippy::redudant_borrow
Diffstat (limited to 'crates/rust-analyzer/src/to_proto.rs')
-rw-r--r-- | crates/rust-analyzer/src/to_proto.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs index 7428a3043..e53cd3c7b 100644 --- a/crates/rust-analyzer/src/to_proto.rs +++ b/crates/rust-analyzer/src/to_proto.rs | |||
@@ -405,7 +405,7 @@ pub(crate) fn semantic_tokens( | |||
405 | text_range = | 405 | text_range = |
406 | TextRange::new(text_range.start(), text_range.end() - TextSize::of('\n')); | 406 | TextRange::new(text_range.start(), text_range.end() - TextSize::of('\n')); |
407 | } | 407 | } |
408 | let range = range(&line_index, text_range); | 408 | let range = range(line_index, text_range); |
409 | builder.push(range, token_index, modifier_bitset); | 409 | builder.push(range, token_index, modifier_bitset); |
410 | } | 410 | } |
411 | } | 411 | } |
@@ -781,7 +781,7 @@ pub(crate) fn snippet_workspace_edit( | |||
781 | document_changes.extend_from_slice(&ops); | 781 | document_changes.extend_from_slice(&ops); |
782 | } | 782 | } |
783 | for (file_id, edit) in source_change.source_file_edits { | 783 | for (file_id, edit) in source_change.source_file_edits { |
784 | let edit = snippet_text_document_edit(&snap, source_change.is_snippet, file_id, edit)?; | 784 | let edit = snippet_text_document_edit(snap, source_change.is_snippet, file_id, edit)?; |
785 | document_changes.push(lsp_ext::SnippetDocumentChangeOperation::Edit(edit)); | 785 | document_changes.push(lsp_ext::SnippetDocumentChangeOperation::Edit(edit)); |
786 | } | 786 | } |
787 | let mut workspace_edit = lsp_ext::SnippetWorkspaceEdit { | 787 | let mut workspace_edit = lsp_ext::SnippetWorkspaceEdit { |
@@ -957,7 +957,7 @@ pub(crate) fn code_lens( | |||
957 | let annotation_range = range(&line_index, annotation.range); | 957 | let annotation_range = range(&line_index, annotation.range); |
958 | 958 | ||
959 | let action = run.action(); | 959 | let action = run.action(); |
960 | let r = runnable(&snap, run)?; | 960 | let r = runnable(snap, run)?; |
961 | 961 | ||
962 | let command = if debug { | 962 | let command = if debug { |
963 | command::debug_single(&r) | 963 | command::debug_single(&r) |
@@ -1236,12 +1236,12 @@ fn main() { | |||
1236 | assert_eq!(folds.len(), 4); | 1236 | assert_eq!(folds.len(), 4); |
1237 | 1237 | ||
1238 | let line_index = LineIndex { | 1238 | let line_index = LineIndex { |
1239 | index: Arc::new(ide::LineIndex::new(&text)), | 1239 | index: Arc::new(ide::LineIndex::new(text)), |
1240 | endings: LineEndings::Unix, | 1240 | endings: LineEndings::Unix, |
1241 | encoding: OffsetEncoding::Utf16, | 1241 | encoding: OffsetEncoding::Utf16, |
1242 | }; | 1242 | }; |
1243 | let converted: Vec<lsp_types::FoldingRange> = | 1243 | let converted: Vec<lsp_types::FoldingRange> = |
1244 | folds.into_iter().map(|it| folding_range(&text, &line_index, true, it)).collect(); | 1244 | folds.into_iter().map(|it| folding_range(text, &line_index, true, it)).collect(); |
1245 | 1245 | ||
1246 | let expected_lines = [(0, 2), (4, 10), (5, 6), (7, 9)]; | 1246 | let expected_lines = [(0, 2), (4, 10), (5, 6), (7, 9)]; |
1247 | assert_eq!(converted.len(), expected_lines.len()); | 1247 | assert_eq!(converted.len(), expected_lines.len()); |