clippy::redudant_borrow

This commit is contained in:
Maan2003
2021-06-13 09:24:16 +05:30
parent d6737e55fb
commit c9b4ac5be4
114 changed files with 285 additions and 285 deletions

View File

@@ -405,7 +405,7 @@ pub(crate) fn semantic_tokens(
text_range =
TextRange::new(text_range.start(), text_range.end() - TextSize::of('\n'));
}
let range = range(&line_index, text_range);
let range = range(line_index, text_range);
builder.push(range, token_index, modifier_bitset);
}
}
@@ -781,7 +781,7 @@ pub(crate) fn snippet_workspace_edit(
document_changes.extend_from_slice(&ops);
}
for (file_id, edit) in source_change.source_file_edits {
let edit = snippet_text_document_edit(&snap, source_change.is_snippet, file_id, edit)?;
let edit = snippet_text_document_edit(snap, source_change.is_snippet, file_id, edit)?;
document_changes.push(lsp_ext::SnippetDocumentChangeOperation::Edit(edit));
}
let mut workspace_edit = lsp_ext::SnippetWorkspaceEdit {
@@ -957,7 +957,7 @@ pub(crate) fn code_lens(
let annotation_range = range(&line_index, annotation.range);
let action = run.action();
let r = runnable(&snap, run)?;
let r = runnable(snap, run)?;
let command = if debug {
command::debug_single(&r)
@@ -1236,12 +1236,12 @@ fn main() {
assert_eq!(folds.len(), 4);
let line_index = LineIndex {
index: Arc::new(ide::LineIndex::new(&text)),
index: Arc::new(ide::LineIndex::new(text)),
endings: LineEndings::Unix,
encoding: OffsetEncoding::Utf16,
};
let converted: Vec<lsp_types::FoldingRange> =
folds.into_iter().map(|it| folding_range(&text, &line_index, true, it)).collect();
folds.into_iter().map(|it| folding_range(text, &line_index, true, it)).collect();
let expected_lines = [(0, 2), (4, 10), (5, 6), (7, 9)];
assert_eq!(converted.len(), expected_lines.len());