From f87472ad7483e2a2d31efee6da52304faf10653d Mon Sep 17 00:00:00 2001 From: Zvonko Kaiser Date: Thu, 6 Jun 2024 07:35:04 +0000 Subject: [PATCH] clippy fixes Signed-off-by: Zvonko Kaiser --- src/generate/generator.rs | 2 +- src/spec_dirs.rs | 2 +- src/utils.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/generate/generator.rs b/src/generate/generator.rs index c8dfe5e..6b33fe7 100644 --- a/src/generate/generator.rs +++ b/src/generate/generator.rs @@ -100,7 +100,7 @@ impl Generator { let idx = self.env_map.entry(key.clone()).or_insert(env_vec.len()); if let Some(elem) = env_vec.get_mut(*idx) { - *elem = env.clone(); + elem.clone_from(env); } else { env_vec.push(env.clone()); self.env_map.insert(key, env_vec.len() - 1); diff --git a/src/spec_dirs.rs b/src/spec_dirs.rs index a4fd85d..e550fd3 100644 --- a/src/spec_dirs.rs +++ b/src/spec_dirs.rs @@ -91,7 +91,7 @@ pub fn with_spec_dirs(dirs: &[&str]) -> CdiOption { .collect(); Box::new(move |cache: &mut Cache| { - cache.spec_dirs = cleaned_dirs.clone(); + cache.spec_dirs.clone_from(&cleaned_dirs); }) } diff --git a/src/utils.rs b/src/utils.rs index 62638da..f4fbcf0 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -19,7 +19,7 @@ where }); if result.is_none() { - result = v2.clone(); + result.clone_from(v2); } result