From 705f7e6e2644bf5de4255bc05ea8d9d5027c29b0 Mon Sep 17 00:00:00 2001 From: Maan2003 Date: Sun, 13 Jun 2021 09:27:19 +0530 Subject: clippy::clone_on_copy --- crates/hir_def/src/attr.rs | 2 +- crates/hir_def/src/item_scope.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/hir_def') diff --git a/crates/hir_def/src/attr.rs b/crates/hir_def/src/attr.rs index d9f9fadc1..2b21cf927 100644 --- a/crates/hir_def/src/attr.rs +++ b/crates/hir_def/src/attr.rs @@ -606,7 +606,7 @@ pub struct DocsRangeMap { impl DocsRangeMap { pub fn map(&self, range: TextRange) -> Option> { let found = self.mapping.binary_search_by(|(probe, ..)| probe.ordering(range)).ok()?; - let (line_docs_range, idx, original_line_src_range) = self.mapping[found].clone(); + let (line_docs_range, idx, original_line_src_range) = self.mapping[found]; if !line_docs_range.contains_range(range) { return None; } diff --git a/crates/hir_def/src/item_scope.rs b/crates/hir_def/src/item_scope.rs index 0f74f050d..08407ebfa 100644 --- a/crates/hir_def/src/item_scope.rs +++ b/crates/hir_def/src/item_scope.rs @@ -59,7 +59,7 @@ pub struct ItemScope { pub(crate) static BUILTIN_SCOPE: Lazy> = Lazy::new(|| { BuiltinType::ALL .iter() - .map(|(name, ty)| (name.clone(), PerNs::types(ty.clone().into(), Visibility::Public))) + .map(|(name, ty)| (name.clone(), PerNs::types((*ty).into(), Visibility::Public))) .collect() }); -- cgit v1.2.3