diff options
author | Thayne McCombs <astrothayne@gmail.com> | 2022-07-25 22:27:26 -0600 |
---|---|---|
committer | Thayne McCombs <astrothayne@gmail.com> | 2022-10-08 00:42:11 -0600 |
commit | e6f4805bae575f6e9df9652d8f7a98fa1b122fad (patch) | |
tree | 4f0a562f85585bb6fcf0c3d95b4a37d19a347a42 | |
parent | 066ce41299adb081b4fce99004efa64907794b4c (diff) |
Fix clippy warnings
-rw-r--r-- | src/cli.rs | 2 | ||||
-rw-r--r-- | src/main.rs | 4 |
2 files changed, 3 insertions, 3 deletions
@@ -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<Config> { .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<OwnerFilter> = opts.owner; @@ -270,7 +270,7 @@ fn construct_config(mut opts: Opts, pattern_regex: &str) -> Result<Config> { 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)] |