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_ty/src/method_resolution.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'crates/hir_ty/src/method_resolution.rs') diff --git a/crates/hir_ty/src/method_resolution.rs b/crates/hir_ty/src/method_resolution.rs index a23527f7d..8c00a6369 100644 --- a/crates/hir_ty/src/method_resolution.rs +++ b/crates/hir_ty/src/method_resolution.rs @@ -372,7 +372,7 @@ pub(crate) fn lookup_method( db, env, krate, - &traits_in_scope, + traits_in_scope, visible_from_module, Some(name), LookupMode::MethodCall, @@ -484,7 +484,7 @@ fn iterate_method_candidates_impl( LookupMode::Path => { // No autoderef for path lookups iterate_method_candidates_for_self_ty( - &ty, + ty, db, env, krate, @@ -513,7 +513,7 @@ fn iterate_method_candidates_with_autoref( db, env.clone(), krate, - &traits_in_scope, + traits_in_scope, visible_from_module, name, &mut callback, @@ -531,7 +531,7 @@ fn iterate_method_candidates_with_autoref( db, env.clone(), krate, - &traits_in_scope, + traits_in_scope, visible_from_module, name, &mut callback, @@ -549,7 +549,7 @@ fn iterate_method_candidates_with_autoref( db, env, krate, - &traits_in_scope, + traits_in_scope, visible_from_module, name, &mut callback, @@ -593,7 +593,7 @@ fn iterate_method_candidates_by_receiver( db, env.clone(), krate, - &traits_in_scope, + traits_in_scope, name, Some(receiver_ty), &mut callback, @@ -870,7 +870,7 @@ fn transform_receiver_ty( .fill_with_unknown() .build(), AssocContainerId::ImplId(impl_id) => { - let impl_substs = inherent_impl_substs(db, env, impl_id, &self_ty)?; + let impl_substs = inherent_impl_substs(db, env, impl_id, self_ty)?; TyBuilder::subst_for_def(db, function_id) .use_parent_substs(&impl_substs) .fill_with_unknown() -- cgit v1.2.3 From 75370312fbfe072947ffdc568eebc9cb4c6108e4 Mon Sep 17 00:00:00 2001 From: Maan2003 Date: Sun, 13 Jun 2021 09:29:36 +0530 Subject: clippy::redundant_closure --- crates/hir_ty/src/method_resolution.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/hir_ty/src/method_resolution.rs') diff --git a/crates/hir_ty/src/method_resolution.rs b/crates/hir_ty/src/method_resolution.rs index 8c00a6369..f3d390961 100644 --- a/crates/hir_ty/src/method_resolution.rs +++ b/crates/hir_ty/src/method_resolution.rs @@ -60,7 +60,7 @@ impl TyFingerprint { TyKind::Adt(AdtId(adt), _) => TyFingerprint::Adt(*adt), TyKind::Raw(mutability, ..) => TyFingerprint::RawPtr(*mutability), TyKind::Foreign(alias_id, ..) => TyFingerprint::ForeignType(*alias_id), - TyKind::Dyn(_) => ty.dyn_trait().map(|trait_| TyFingerprint::Dyn(trait_))?, + TyKind::Dyn(_) => ty.dyn_trait().map(TyFingerprint::Dyn)?, _ => return None, }; Some(fp) @@ -77,7 +77,7 @@ impl TyFingerprint { TyKind::Adt(AdtId(adt), _) => TyFingerprint::Adt(*adt), TyKind::Raw(mutability, ..) => TyFingerprint::RawPtr(*mutability), TyKind::Foreign(alias_id, ..) => TyFingerprint::ForeignType(*alias_id), - TyKind::Dyn(_) => ty.dyn_trait().map(|trait_| TyFingerprint::Dyn(trait_))?, + TyKind::Dyn(_) => ty.dyn_trait().map(TyFingerprint::Dyn)?, TyKind::Ref(_, _, ty) => return TyFingerprint::for_trait_impl(ty), TyKind::Tuple(_, subst) => { let first_ty = subst.interned().get(0).map(|arg| arg.assert_ty_ref(&Interner)); -- cgit v1.2.3