From 3d9b3a8575ef3cb557fd847b941000df3b2db670 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Sun, 21 Mar 2021 12:05:08 +0100 Subject: remove more redundant clones (clippy::redundant_clone()) --- crates/hir_ty/src/lower.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'crates/hir_ty/src') diff --git a/crates/hir_ty/src/lower.rs b/crates/hir_ty/src/lower.rs index cbbb535e5..c914a3b8e 100644 --- a/crates/hir_ty/src/lower.rs +++ b/crates/hir_ty/src/lower.rs @@ -946,8 +946,7 @@ pub(crate) fn trait_environment_query( let substs = Substitution::type_params(db, trait_id); let trait_ref = TraitRef { trait_id: to_chalk_trait_id(trait_id), substitution: substs }; let pred = WhereClause::Implemented(trait_ref); - let program_clause: chalk_ir::ProgramClause = - pred.clone().to_chalk(db).cast(&Interner); + let program_clause: chalk_ir::ProgramClause = pred.to_chalk(db).cast(&Interner); clauses.push(program_clause.into_from_env_clause(&Interner)); } -- cgit v1.2.3 From ae7e55c1dd801c60092205ec8890179e10a47814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Sun, 21 Mar 2021 13:13:34 +0100 Subject: clippy::complexity simplifications related to Iterators --- crates/hir_ty/src/infer/pat.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/hir_ty/src') diff --git a/crates/hir_ty/src/infer/pat.rs b/crates/hir_ty/src/infer/pat.rs index befa0d69b..ec491648f 100644 --- a/crates/hir_ty/src/infer/pat.rs +++ b/crates/hir_ty/src/infer/pat.rs @@ -38,7 +38,7 @@ impl<'a> InferenceContext<'a> { let field_tys = def.map(|it| self.db.field_types(it)).unwrap_or_default(); let (pre, post) = match ellipsis { Some(idx) => subpats.split_at(idx), - None => (&subpats[..], &[][..]), + None => (subpats, &[][..]), }; let post_idx_offset = field_tys.iter().count() - post.len(); -- cgit v1.2.3