don't panic if file already exists

This commit is contained in:
Max Bradbury 2022-06-27 23:00:08 +01:00
parent ef4d2816b3
commit 2b5ddee232
1 changed files with 4 additions and 2 deletions

View File

@ -39,8 +39,10 @@ fn move_file(file: PathBuf, mut destination: PathBuf) {
destination.push(file_name);
fs_extra::file::move_file(file, destination, &Default::default())
.expect("Couldn't move file");
match fs_extra::file::move_file(file, destination, &Default::default()) {
Ok(_) => println!("OK!"),
Err(e) => println!("Couldn't move file: {:?}", e),
}
}
fn yes() -> bool {