diff --git a/src/fileinfo.rs b/src/fileinfo.rs index ed55aa7..140fb52 100644 --- a/src/fileinfo.rs +++ b/src/fileinfo.rs @@ -20,7 +20,6 @@ impl FileInfo { mapper .chunks(1_000_000) - .into_iter() .for_each(|chunk| primhasher.write(chunk)); Ok(Self { diff --git a/src/formatter.rs b/src/formatter.rs index 3f63592..fe6bcdb 100644 --- a/src/formatter.rs +++ b/src/formatter.rs @@ -16,8 +16,12 @@ use std::path::PathBuf; use std::time::Duration; impl Formatter { - pub fn human_path(file: &FileInfo, app_args: &Params, min_path_length: usize) -> Result { - let base_directory: PathBuf = app_args.get_directory()?.to_path_buf(); + pub fn human_path( + file: &FileInfo, + app_args: &Params, + min_path_length: usize, + ) -> Result { + let base_directory: PathBuf = app_args.get_directory()?; let relative_path = diff_paths(file.path.clone(), base_directory).unwrap_or_default(); let formatted_path = format!( @@ -61,8 +65,7 @@ impl Formatter { progress_bar.set_message("reconciling data"); let duplicates_table: DashMap> = DashMap::new(); - raw.clone() - .into_par_iter() + raw.into_par_iter() .progress_with(progress_bar) .with_finish(ProgressFinish::WithMessage(Cow::from("data reconciled"))) .map(|file| file.hash()) @@ -95,11 +98,11 @@ impl Formatter { inner_table.set_format(*format::consts::FORMAT_NO_BORDER_LINE_SEPARATOR); group.iter().for_each(|file| { inner_table.add_row(row![ - Self::human_path(&file, &app_args, min_path_length) + Self::human_path(file, app_args, min_path_length) .unwrap_or_default() .blue(), - Self::human_filesize(&file).unwrap_or_default().red(), - Self::human_mtime(&file).unwrap_or_default().yellow() + Self::human_filesize(file).unwrap_or_default().red(), + Self::human_mtime(file).unwrap_or_default().yellow() ]); }); diff --git a/src/interactive.rs b/src/interactive.rs index 767ef7d..9e6c2b0 100644 --- a/src/interactive.rs +++ b/src/interactive.rs @@ -60,7 +60,6 @@ pub fn init(result: Vec, app_args: &Params) -> Result<()> { let duplicates: DashMap> = DashMap::new(); result - .clone() .into_par_iter() .progress_with(progress_bar) .with_finish(ProgressFinish::WithMessage(Cow::from("data reconciled"))) @@ -84,11 +83,11 @@ pub fn init(result: Vec, app_args: &Params) -> Result<()> { group.iter().enumerate().for_each(|(index, file)| { itable.add_row(row![ index, - Formatter::human_path(&file, app_args, max_filepath_length) + Formatter::human_path(file, app_args, min_path_length) .unwrap_or_default() .blue(), Formatter::human_filesize(file).unwrap_or_default().red(), - Formatter::human_mtime(&file).unwrap_or_default().yellow() + Formatter::human_mtime(file).unwrap_or_default().yellow() ]); }); diff --git a/src/scanner.rs b/src/scanner.rs index 5ae5f38..25f49d9 100644 --- a/src/scanner.rs +++ b/src/scanner.rs @@ -161,7 +161,7 @@ impl Scanner { path }) .filter(|path| path.is_file()) - .map(|file| FileInfo::new(file)) + .map(FileInfo::new) .filter_map(Result::ok) .filter(|file| file.size > min_size) .collect::>();