diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-07-04 22:56:36 +0100 |
---|---|---|
committer | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-07-04 22:56:36 +0100 |
commit | b1bf434dfcf81ac681a9e152628f9eecde68470a (patch) | |
tree | 51ea069481d3a5eefa9ec1f558a12c85690dabce /crates/ra_hir/src/nameres/collector.rs | |
parent | c6a6e43372de9530ec7df0f38352466ed107e1a2 (diff) | |
parent | e7fb6c83cc33facf0d74e253bd193afc46b1dc5c (diff) |
Merge #1482
1482: Some clippy fixes for 1.36 r=kjeremy a=kjeremy
Some clippy fixes now that 1.36 is released. ~~Plus the requisite format run (I can rebase after #1481 is merged to make this cleaner) .~~
The change from `map(|it| *it)` to `copied()` changes the minimum rust stable to 1.36.
Co-authored-by: Jeremy Kolb <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/nameres/collector.rs')
-rw-r--r-- | crates/ra_hir/src/nameres/collector.rs | 14 |
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), |