From 9c7fd5e8cb1f5736235461ed521102b9182a538d Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 23 Dec 2023 13:05:52 +0100 Subject: [PATCH] mv: rename the variable to match the name in cp --- src/uu/mv/src/mv.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/uu/mv/src/mv.rs b/src/uu/mv/src/mv.rs index 75a295502..058532851 100644 --- a/src/uu/mv/src/mv.rs +++ b/src/uu/mv/src/mv.rs @@ -434,7 +434,7 @@ pub fn mv(files: &[OsString], opts: &Options) -> UResult<()> { } #[allow(clippy::cognitive_complexity)] -fn move_files_into_dir(files: &[PathBuf], target_dir: &Path, opts: &Options) -> UResult<()> { +fn move_files_into_dir(files: &[PathBuf], target_dir: &Path, options: &Options) -> UResult<()> { // remember the moved destinations for further usage let mut moved_destinations: HashSet = HashSet::with_capacity(files.len()); @@ -446,7 +446,7 @@ fn move_files_into_dir(files: &[PathBuf], target_dir: &Path, opts: &Options) -> .canonicalize() .unwrap_or_else(|_| target_dir.to_path_buf()); - let multi_progress = opts.progress_bar.then(MultiProgress::new); + let multi_progress = options.progress_bar.then(MultiProgress::new); let count_progress = if let Some(ref multi_progress) = multi_progress { if files.len() > 1 { @@ -475,7 +475,8 @@ fn move_files_into_dir(files: &[PathBuf], target_dir: &Path, opts: &Options) -> } }; - if moved_destinations.contains(&targetpath) && opts.backup != BackupMode::NumberedBackup { + if moved_destinations.contains(&targetpath) && options.backup != BackupMode::NumberedBackup + { // If the target file was already created in this mv call, do not overwrite return Err(USimpleError::new( 1, @@ -509,7 +510,7 @@ fn move_files_into_dir(files: &[PathBuf], target_dir: &Path, opts: &Options) -> } } - match rename(sourcepath, &targetpath, opts, multi_progress.as_ref()) { + match rename(sourcepath, &targetpath, options, multi_progress.as_ref()) { Err(e) if e.to_string().is_empty() => set_exit_code(1), Err(e) => { let e = e.map_err_context(|| {