aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/nameres
diff options
context:
space:
mode:
authorJeremy Kolb <[email protected]>2019-07-04 18:26:44 +0100
committerJeremy Kolb <[email protected]>2019-07-04 22:43:00 +0100
commit4ad9e986ad05e404df73701c098b71f73a847ca6 (patch)
tree2a2b2cc9dbee07d0aa92df883c807edbab264a85 /crates/ra_hir/src/nameres
parentc6a6e43372de9530ec7df0f38352466ed107e1a2 (diff)
Some clippy fixes for 1.36
Diffstat (limited to 'crates/ra_hir/src/nameres')
-rw-r--r--crates/ra_hir/src/nameres/collector.rs14
1 files changed, 5 insertions, 9 deletions
diff --git a/crates/ra_hir/src/nameres/collector.rs b/crates/ra_hir/src/nameres/collector.rs
index 2b07ebf4a..d66be34db 100644
--- a/crates/ra_hir/src/nameres/collector.rs
+++ b/crates/ra_hir/src/nameres/collector.rs
@@ -227,10 +227,8 @@ where
227 .items 227 .items
228 .iter() 228 .iter()
229 .map(|(name, res)| (name.clone(), Either::A(res.clone()))); 229 .map(|(name, res)| (name.clone(), Either::A(res.clone())));
230 let macros = scope 230 let macros =
231 .macros 231 scope.macros.iter().map(|(name, res)| (name.clone(), Either::B(*res)));
232 .iter()
233 .map(|(name, res)| (name.clone(), Either::B(res.clone())));
234 232
235 let all = items.chain(macros).collect::<Vec<_>>(); 233 let all = items.chain(macros).collect::<Vec<_>>();
236 self.update(module_id, Some(import_id), &all); 234 self.update(module_id, Some(import_id), &all);
@@ -243,10 +241,8 @@ where
243 .items 241 .items
244 .iter() 242 .iter()
245 .map(|(name, res)| (name.clone(), Either::A(res.clone()))); 243 .map(|(name, res)| (name.clone(), Either::A(res.clone())));
246 let macros = scope 244 let macros =
247 .macros 245 scope.macros.iter().map(|(name, res)| (name.clone(), Either::B(*res)));
248 .iter()
249 .map(|(name, res)| (name.clone(), Either::B(res.clone())));
250 246
251 let all = items.chain(macros).collect::<Vec<_>>(); 247 let all = items.chain(macros).collect::<Vec<_>>();
252 248
@@ -651,7 +647,7 @@ fn resolve_submodule(
651 candidates.push(file_dir_mod.clone()); 647 candidates.push(file_dir_mod.clone());
652 }; 648 };
653 let sr = db.source_root(source_root_id); 649 let sr = db.source_root(source_root_id);
654 let mut points_to = candidates.into_iter().filter_map(|path| sr.files.get(&path)).map(|&it| it); 650 let mut points_to = candidates.into_iter().filter_map(|path| sr.files.get(&path)).copied();
655 // FIXME: handle ambiguity 651 // FIXME: handle ambiguity
656 match points_to.next() { 652 match points_to.next() {
657 Some(file_id) => Ok(file_id), 653 Some(file_id) => Ok(file_id),