From 02b6f871f174f510cd258c5064dcbe08cadd11d3 Mon Sep 17 00:00:00 2001 From: Alan Du Date: Tue, 4 Jun 2019 03:07:57 -0400 Subject: Fix clippy::iter_cloned_collect --- crates/ra_hir/src/nameres.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'crates/ra_hir') diff --git a/crates/ra_hir/src/nameres.rs b/crates/ra_hir/src/nameres.rs index c59c30579..8b798d6c9 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) = -- cgit v1.2.3