From e6f4805bae575f6e9df9652d8f7a98fa1b122fad Mon Sep 17 00:00:00 2001 From: Thayne McCombs Date: Mon, 25 Jul 2022 22:27:26 -0600 Subject: [PATCH] Fix clippy warnings --- src/cli.rs | 2 +- src/main.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index cb127e3..fdd6140 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -554,7 +554,7 @@ impl Opts { Ok(paths .iter() .filter_map(|path| { - if filesystem::is_existing_directory(&path) { + if filesystem::is_existing_directory(path) { Some(self.normalize_path(path)) } else { print_error(format!( diff --git a/src/main.rs b/src/main.rs index 7857949..86c4ef5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -182,7 +182,7 @@ fn construct_config(mut opts: Opts, pattern_regex: &str) -> Result { .unwrap_or_else(|| std::path::MAIN_SEPARATOR.to_string()); check_path_separator_length(path_separator.as_deref())?; - let size_limits = std::mem::replace(&mut opts.size, vec![]); + let size_limits = std::mem::take(&mut opts.size); let time_constraints = extract_time_constraints(&opts)?; #[cfg(unix)] let owner_constraint: Option = opts.owner; @@ -270,7 +270,7 @@ fn construct_config(mut opts: Opts, pattern_regex: &str) -> Result { command: command.map(Arc::new), batch_size: opts.batch_size, exclude_patterns: opts.exclude.iter().map(|p| String::from("!") + p).collect(), - ignore_files: std::mem::replace(&mut opts.ignore_file, vec![]), + ignore_files: std::mem::take(&mut opts.ignore_file), size_constraints: size_limits, time_constraints, #[cfg(unix)]