Skip to content

Commit c61033b

Browse files
Remove unnecessary clones when their receivers can be moved instead
1 parent b570c73 commit c61033b

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

crates/prek/src/cli/install.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ fn get_hook_types(
179179
.filter(|p| p.exists());
180180
if let Some(path) = config.into_iter().chain(fallbacks).next() {
181181
match load_config(path) {
182-
Ok(cfg) => cfg.default_install_hook_types.clone().unwrap_or_default(),
182+
Ok(cfg) => cfg.default_install_hook_types.unwrap_or_default(),
183183
Err(err) => {
184184
err.warn_parse_error();
185185
vec![]

crates/prek/src/languages/python/version.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ mod tests {
217217

218218
let range_req = semver::VersionReq::parse(">=3.12").unwrap();
219219
assert!(
220-
PythonRequest::Range(range_req.clone(), ">=3.12".to_string())
220+
PythonRequest::Range(range_req, ">=3.12".to_string())
221221
.satisfied_by(&install_info)
222222
);
223223

crates/prek/src/languages/rust/version.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ mod tests {
318318
InstallInfo::new(Language::Rust, FxHashSet::default(), temp_dir.path())?;
319319
install_info
320320
.with_language_version(semver::Version::new(1, 71, 0))
321-
.with_toolchain(toolchain_path.clone());
321+
.with_toolchain(toolchain_path);
322322

323323
assert!(RustRequest::Any.satisfied_by(&install_info));
324324
assert!(RustRequest::Major(1).satisfied_by(&install_info));

0 commit comments

Comments
 (0)