From 4ad9e986ad05e404df73701c098b71f73a847ca6 Mon Sep 17 00:00:00 2001 From: Jeremy Kolb Date: Thu, 4 Jul 2019 13:26:44 -0400 Subject: Some clippy fixes for 1.36 --- crates/ra_ide_api/src/db.rs | 4 ++-- crates/ra_ide_api/src/display/structure.rs | 2 +- crates/ra_ide_api/src/line_index_utils.rs | 5 ++--- crates/ra_ide_api/src/symbol_index.rs | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) (limited to 'crates/ra_ide_api/src') diff --git a/crates/ra_ide_api/src/db.rs b/crates/ra_ide_api/src/db.rs index fc5b06ca8..44216b045 100644 --- a/crates/ra_ide_api/src/db.rs +++ b/crates/ra_ide_api/src/db.rs @@ -72,8 +72,8 @@ impl salsa::ParallelDatabase for RootDatabase { fn snapshot(&self) -> salsa::Snapshot { salsa::Snapshot::new(RootDatabase { runtime: self.runtime.snapshot(self), - last_gc: self.last_gc.clone(), - last_gc_check: self.last_gc_check.clone(), + last_gc: self.last_gc, + last_gc_check: self.last_gc_check, }) } } diff --git a/crates/ra_ide_api/src/display/structure.rs b/crates/ra_ide_api/src/display/structure.rs index e5b257b9b..638484a9b 100644 --- a/crates/ra_ide_api/src/display/structure.rs +++ b/crates/ra_ide_api/src/display/structure.rs @@ -25,7 +25,7 @@ pub fn file_structure(file: &SourceFile) -> Vec { match event { WalkEvent::Enter(node) => { if let Some(mut symbol) = structure_node(node) { - symbol.parent = stack.last().map(|&n| n); + symbol.parent = stack.last().copied(); stack.push(res.len()); res.push(symbol); } diff --git a/crates/ra_ide_api/src/line_index_utils.rs b/crates/ra_ide_api/src/line_index_utils.rs index f9073dca2..8f63db5f1 100644 --- a/crates/ra_ide_api/src/line_index_utils.rs +++ b/crates/ra_ide_api/src/line_index_utils.rs @@ -137,7 +137,7 @@ impl<'a> Edits<'a> { Step::Newline(n) => n, Step::Utf16Char(r) => r.end(), }; - let res = match &mut self.current { + match &mut self.current { Some(edit) => { if step_pos <= edit.delete.start() { NextSteps::Use @@ -155,8 +155,7 @@ impl<'a> Edits<'a> { } } None => NextSteps::Use, - }; - res + } } fn translate_range(&self, range: TextRange) -> TextRange { diff --git a/crates/ra_ide_api/src/symbol_index.rs b/crates/ra_ide_api/src/symbol_index.rs index 2ca0a25d4..f4a0c6ac7 100644 --- a/crates/ra_ide_api/src/symbol_index.rs +++ b/crates/ra_ide_api/src/symbol_index.rs @@ -87,7 +87,7 @@ pub(crate) fn world_symbols(db: &RootDatabase, query: Query) -> Vec let mut files = Vec::new(); for &root in db.local_roots().iter() { let sr = db.source_root(root); - files.extend(sr.files.values().map(|&it| it)) + files.extend(sr.files.values().copied()) } let snap = Snap(db.snapshot()); -- cgit v1.2.3