diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index 0417196843..a9d15274fa 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs @@ -1530,11 +1530,7 @@ impl SelfParam { let ctx = hir_ty::TyLoweringContext::new(db, &resolver); let environment = db.trait_environment(self.func.into()); - Type { - krate, - env: environment.clone(), - ty: ctx.lower_ty(&db.function_data(self.func).params[0].1), - } + Type { krate, env: environment, ty: ctx.lower_ty(&db.function_data(self.func).params[0].1) } } } diff --git a/crates/hir_def/src/nameres/attr_resolution.rs b/crates/hir_def/src/nameres/attr_resolution.rs index a7e2c3e8ad..3650204ee9 100644 --- a/crates/hir_def/src/nameres/attr_resolution.rs +++ b/crates/hir_def/src/nameres/attr_resolution.rs @@ -52,7 +52,7 @@ impl DefMap { return Ok(ResolvedAttr::Other); } } - None => return Err(UnresolvedMacro { path: ast_id.path.clone() }), + None => return Err(UnresolvedMacro { path: ast_id.path }), }; Ok(ResolvedAttr::Macro(attr_macro_as_call_id( diff --git a/crates/hir_ty/src/infer.rs b/crates/hir_ty/src/infer.rs index c84604d69b..0c62f58940 100644 --- a/crates/hir_ty/src/infer.rs +++ b/crates/hir_ty/src/infer.rs @@ -82,7 +82,7 @@ pub(crate) fn normalize(db: &dyn HirDatabase, owner: DefWithBodyId, ty: Ty) -> T let trait_env = owner .as_generic_def_id() .map_or_else(|| Arc::new(TraitEnvironment::empty(krate)), |d| db.trait_environment(d)); - let mut table = unify::InferenceTable::new(db, trait_env.clone()); + let mut table = unify::InferenceTable::new(db, trait_env); let ty_with_vars = table.normalize_associated_types_in(ty); table.resolve_obligations_as_possible(); diff --git a/crates/hir_ty/src/method_resolution.rs b/crates/hir_ty/src/method_resolution.rs index fdf884a76d..00c0de7f93 100644 --- a/crates/hir_ty/src/method_resolution.rs +++ b/crates/hir_ty/src/method_resolution.rs @@ -663,7 +663,7 @@ pub fn iterate_method_candidates_dyn( iterate_method_candidates_for_self_ty( ty, db, - env.clone(), + env, traits_in_scope, visible_from_module, name, @@ -731,7 +731,7 @@ fn iterate_method_candidates_with_autoref( first_adjustment.with_autoref(Mutability::Mut), deref_chain, db, - env.clone(), + env, traits_in_scope, visible_from_module, name, diff --git a/crates/ide_db/src/defs.rs b/crates/ide_db/src/defs.rs index fc48e642f0..e60c3b04e8 100644 --- a/crates/ide_db/src/defs.rs +++ b/crates/ide_db/src/defs.rs @@ -306,7 +306,7 @@ impl NameClass { if let Some(it) = ast::LifetimeParam::cast(parent.clone()) { sema.to_def(&it).map(Into::into).map(Definition::GenericParam) - } else if let Some(it) = ast::Label::cast(parent.clone()) { + } else if let Some(it) = ast::Label::cast(parent) { sema.to_def(&it).map(Definition::Label) } else { None