diff options
Diffstat (limited to 'crates/ra_ide_api')
-rw-r--r-- | crates/ra_ide_api/src/db.rs | 4 | ||||
-rw-r--r-- | crates/ra_ide_api/src/display/structure.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide_api/src/line_index_utils.rs | 5 | ||||
-rw-r--r-- | crates/ra_ide_api/src/symbol_index.rs | 2 |
4 files changed, 6 insertions, 7 deletions
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 { | |||
72 | fn snapshot(&self) -> salsa::Snapshot<RootDatabase> { | 72 | fn snapshot(&self) -> salsa::Snapshot<RootDatabase> { |
73 | salsa::Snapshot::new(RootDatabase { | 73 | salsa::Snapshot::new(RootDatabase { |
74 | runtime: self.runtime.snapshot(self), | 74 | runtime: self.runtime.snapshot(self), |
75 | last_gc: self.last_gc.clone(), | 75 | last_gc: self.last_gc, |
76 | last_gc_check: self.last_gc_check.clone(), | 76 | last_gc_check: self.last_gc_check, |
77 | }) | 77 | }) |
78 | } | 78 | } |
79 | } | 79 | } |
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<StructureNode> { | |||
25 | match event { | 25 | match event { |
26 | WalkEvent::Enter(node) => { | 26 | WalkEvent::Enter(node) => { |
27 | if let Some(mut symbol) = structure_node(node) { | 27 | if let Some(mut symbol) = structure_node(node) { |
28 | symbol.parent = stack.last().map(|&n| n); | 28 | symbol.parent = stack.last().copied(); |
29 | stack.push(res.len()); | 29 | stack.push(res.len()); |
30 | res.push(symbol); | 30 | res.push(symbol); |
31 | } | 31 | } |
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> { | |||
137 | Step::Newline(n) => n, | 137 | Step::Newline(n) => n, |
138 | Step::Utf16Char(r) => r.end(), | 138 | Step::Utf16Char(r) => r.end(), |
139 | }; | 139 | }; |
140 | let res = match &mut self.current { | 140 | match &mut self.current { |
141 | Some(edit) => { | 141 | Some(edit) => { |
142 | if step_pos <= edit.delete.start() { | 142 | if step_pos <= edit.delete.start() { |
143 | NextSteps::Use | 143 | NextSteps::Use |
@@ -155,8 +155,7 @@ impl<'a> Edits<'a> { | |||
155 | } | 155 | } |
156 | } | 156 | } |
157 | None => NextSteps::Use, | 157 | None => NextSteps::Use, |
158 | }; | 158 | } |
159 | res | ||
160 | } | 159 | } |
161 | 160 | ||
162 | fn translate_range(&self, range: TextRange) -> TextRange { | 161 | 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<FileSymbol> | |||
87 | let mut files = Vec::new(); | 87 | let mut files = Vec::new(); |
88 | for &root in db.local_roots().iter() { | 88 | for &root in db.local_roots().iter() { |
89 | let sr = db.source_root(root); | 89 | let sr = db.source_root(root); |
90 | files.extend(sr.files.values().map(|&it| it)) | 90 | files.extend(sr.files.values().copied()) |
91 | } | 91 | } |
92 | 92 | ||
93 | let snap = Snap(db.snapshot()); | 93 | let snap = Snap(db.snapshot()); |