From 8206939fed0e2307455d46620ee114f74ab35d7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Wed, 26 May 2021 18:34:50 +0300 Subject: clippy::redundant_clone fixes --- crates/project_model/src/build_data.rs | 6 +++--- crates/project_model/src/cargo_workspace.rs | 7 ++----- 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'crates/project_model/src') diff --git a/crates/project_model/src/build_data.rs b/crates/project_model/src/build_data.rs index 3aa546980..33a4f8168 100644 --- a/crates/project_model/src/build_data.rs +++ b/crates/project_model/src/build_data.rs @@ -214,7 +214,7 @@ impl WorkspaceBuildData { acc }; let package_build_data = - res.per_package.entry(package_id.repr.clone()).or_default(); + res.per_package.entry(package_id.repr).or_default(); // cargo_metadata crate returns default (empty) path for // older cargos, which is not absolute, so work around that. if !out_dir.as_str().is_empty() { @@ -237,13 +237,13 @@ impl WorkspaceBuildData { { let filename = AbsPathBuf::assert(PathBuf::from(&filename)); let package_build_data = - res.per_package.entry(package_id.repr.clone()).or_default(); + res.per_package.entry(package_id.repr).or_default(); package_build_data.proc_macro_dylib_path = Some(filename); } } } Message::CompilerMessage(message) => { - progress(message.target.name.clone()); + progress(message.target.name); } Message::BuildFinished(_) => {} Message::TextLine(_) => {} diff --git a/crates/project_model/src/cargo_workspace.rs b/crates/project_model/src/cargo_workspace.rs index a8fee4f08..b8ad08364 100644 --- a/crates/project_model/src/cargo_workspace.rs +++ b/crates/project_model/src/cargo_workspace.rs @@ -346,11 +346,8 @@ impl CargoWorkspace { let workspace_root = AbsPathBuf::assert(PathBuf::from(meta.workspace_root.into_os_string())); - let build_data_config = BuildDataConfig::new( - cargo_toml.to_path_buf(), - config.clone(), - Arc::new(meta.packages.clone()), - ); + let build_data_config = + BuildDataConfig::new(cargo_toml.to_path_buf(), config.clone(), Arc::new(meta.packages)); Ok(CargoWorkspace { packages, targets, workspace_root, build_data_config }) } -- cgit v1.2.3