From c9b4ac5be4daaabc062ab1ee663eba8594750003 Mon Sep 17 00:00:00 2001 From: Maan2003 Date: Sun, 13 Jun 2021 09:24:16 +0530 Subject: clippy::redudant_borrow --- crates/hir/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/hir/src/lib.rs') diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index 2468c0dc6..f6eb23262 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs @@ -1112,7 +1112,7 @@ impl Function { .collect(); sink.push(MissingFields { file: source_ptr.file_id, - field_list_parent: AstPtr::new(&record_expr), + field_list_parent: AstPtr::new(record_expr), field_list_parent_path: record_expr .path() .map(|path| AstPtr::new(&path)), @@ -2531,13 +2531,13 @@ impl Type { match ty.kind(&Interner) { TyKind::Adt(_, substs) => { cb(type_.derived(ty.clone())); - walk_substs(db, type_, &substs, cb); + walk_substs(db, type_, substs, cb); } TyKind::AssociatedType(_, substs) => { if let Some(_) = ty.associated_type_parent_trait(db) { cb(type_.derived(ty.clone())); } - walk_substs(db, type_, &substs, cb); + walk_substs(db, type_, substs, cb); } TyKind::OpaqueType(_, subst) => { if let Some(bounds) = ty.impl_trait_bounds(db) { @@ -2577,7 +2577,7 @@ impl Type { TyKind::FnDef(_, substs) | TyKind::Tuple(_, substs) | TyKind::Closure(.., substs) => { - walk_substs(db, type_, &substs, cb); + walk_substs(db, type_, substs, cb); } TyKind::Function(hir_ty::FnPointer { substitution, .. }) => { walk_substs(db, type_, &substitution.0, cb); -- cgit v1.2.3 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/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/hir/src/lib.rs') diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index f6eb23262..bd923cba8 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs @@ -452,7 +452,7 @@ impl Module { } pub fn visibility_of(self, db: &dyn HirDatabase, def: &ModuleDef) -> Option { - self.id.def_map(db.upcast())[self.id.local_id].scope.visibility_of(def.clone().into()) + self.id.def_map(db.upcast())[self.id.local_id].scope.visibility_of((*def).into()) } pub fn diagnostics( -- cgit v1.2.3