From ea0014c500e9488d5a0e32e2c3db76fb803503bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Tue, 27 Jul 2021 12:28:58 +0300 Subject: [PATCH] Remove some redundant clones --- crates/hir_ty/src/infer/closure.rs | 5 +---- crates/rust-analyzer/src/main_loop.rs | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/crates/hir_ty/src/infer/closure.rs b/crates/hir_ty/src/infer/closure.rs index e4fcc56bc45b..94dcff7f2a69 100644 --- a/crates/hir_ty/src/infer/closure.rs +++ b/crates/hir_ty/src/infer/closure.rs @@ -75,10 +75,7 @@ impl InferenceContext<'_> { safety: chalk_ir::Safety::Safe, variadic: false, }, - substitution: FnSubst(Substitution::from_iter( - &Interner, - sig_tys.clone(), - )), + substitution: FnSubst(Substitution::from_iter(&Interner, sig_tys)), }); } } diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs index 35fce79f5eb6..62ff922e1ffe 100644 --- a/crates/rust-analyzer/src/main_loop.rs +++ b/crates/rust-analyzer/src/main_loop.rs @@ -636,7 +636,7 @@ impl GlobalState { let mut text = String::from_utf8(vfs.file_contents(file_id).to_vec()).unwrap(); apply_document_changes(&mut text, params.content_changes); - vfs.set_file_contents(path.clone(), Some(text.into_bytes())); + vfs.set_file_contents(path, Some(text.into_bytes())); } Ok(()) })?