diff --git a/src/main.rs b/src/main.rs index 73e99f8..cc7d05d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -259,7 +259,7 @@ fn main() -> Result<(), String> { .into_iter() .map(|file| { FileNameInfo::try_from(file.clone()) - .map(|info| (PathBuf::from(&file), info)) + .map(|info| (file.clone(), info)) .map_err(|e| format!("Bad file '{}': {e}", file.to_string_lossy())) }) .collect::, _>>()? @@ -387,12 +387,12 @@ fn main() -> Result<(), String> { let mut actions = present_file_names .iter() .filter(|file| file_matcher.matches(file)) - .map(|file| { + .map(|present_file| { //special case -> file has the same name as current file, then we just need to replace it - if *file == file_name { + if *present_file == file_name { FileAction::new(file, Action::Replace).expect("path points to file") } else { - FileAction::new(file, Action::Delete).expect("path points to file") + FileAction::new(present_file, Action::Delete).expect("path points to file") } }) .collect::>(); @@ -421,6 +421,10 @@ fn main() -> Result<(), String> { log!(logger, "The following actions will be performed: "); for server_actions in &actions { log!(logger, "{server_actions}"); + log!(logger, debug, "Detailed file actions: "); + for file_action in &server_actions.actions { + log!(logger, debug, "{file_action:?}"); + } } if !no_confirm {