From 1eb08c06d0c9ea08331955cf5e837748cc3be0d6 Mon Sep 17 00:00:00 2001 From: Alan Du Date: Tue, 4 Jun 2019 03:07:57 -0400 Subject: [PATCH] Fix clippy::iter_cloned_collect --- crates/ra_hir/src/nameres.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/crates/ra_hir/src/nameres.rs b/crates/ra_hir/src/nameres.rs index c59c30579513..8b798d6c9a9f 100644 --- a/crates/ra_hir/src/nameres.rs +++ b/crates/ra_hir/src/nameres.rs @@ -422,10 +422,8 @@ impl CrateDefMap { curr_per_ns = match curr { ModuleDef::Module(module) => { if module.krate != self.krate { - let path = Path { - segments: path.segments[i..].iter().cloned().collect(), - kind: PathKind::Self_, - }; + let path = + Path { segments: path.segments[i..].to_vec(), kind: PathKind::Self_ }; log::debug!("resolving {:?} in other crate", path); let defp_map = db.crate_def_map(module.krate); let (def, s) =