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_hir/src/nameres/collector.rs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'crates/ra_hir/src/nameres/collector.rs') 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 .items .iter() .map(|(name, res)| (name.clone(), Either::A(res.clone()))); - let macros = scope - .macros - .iter() - .map(|(name, res)| (name.clone(), Either::B(res.clone()))); + let macros = + scope.macros.iter().map(|(name, res)| (name.clone(), Either::B(*res))); let all = items.chain(macros).collect::>(); self.update(module_id, Some(import_id), &all); @@ -243,10 +241,8 @@ where .items .iter() .map(|(name, res)| (name.clone(), Either::A(res.clone()))); - let macros = scope - .macros - .iter() - .map(|(name, res)| (name.clone(), Either::B(res.clone()))); + let macros = + scope.macros.iter().map(|(name, res)| (name.clone(), Either::B(*res))); let all = items.chain(macros).collect::>(); @@ -651,7 +647,7 @@ fn resolve_submodule( candidates.push(file_dir_mod.clone()); }; let sr = db.source_root(source_root_id); - let mut points_to = candidates.into_iter().filter_map(|path| sr.files.get(&path)).map(|&it| it); + let mut points_to = candidates.into_iter().filter_map(|path| sr.files.get(&path)).copied(); // FIXME: handle ambiguity match points_to.next() { Some(file_id) => Ok(file_id), -- cgit v1.2.3