diff --git a/src/archive/tar.rs b/src/archive/tar.rs index acf0908..85b41b7 100644 --- a/src/archive/tar.rs +++ b/src/archive/tar.rs @@ -9,7 +9,6 @@ use std::{ }; use fs_err as fs; -use tar; use crate::{ error::FinalError, @@ -40,7 +39,12 @@ pub fn unpack_archive( // spoken text for users using screen readers, braille displays // and so on - info!(@display_handle, inaccessible, "{:?} extracted. ({})", utils::strip_cur_dir(&output_folder.join(file.path()?)), Bytes::new(file.size())); + info!( + @display_handle, + inaccessible, + "{:?} extracted. ({})", + utils::strip_cur_dir(&output_folder.join(file.path()?)), Bytes::new(file.size()) + ); files_unpacked.push(file_path); } diff --git a/src/archive/zip.rs b/src/archive/zip.rs index b3e329b..bae50a3 100644 --- a/src/archive/zip.rs +++ b/src/archive/zip.rs @@ -68,7 +68,12 @@ where let file_path = strip_cur_dir(file_path.as_path()); // same reason is in _is_dir: long, often not needed text - info!(@display_handle, inaccessible, "{:?} extracted. ({})", file_path.display(), Bytes::new(file.size())); + info!( + @display_handle, + inaccessible, + "{:?} extracted. ({})", + file_path.display(), Bytes::new(file.size()) + ); let mut output_file = fs::File::create(file_path)?; io::copy(&mut file, &mut output_file)?; diff --git a/src/utils/question.rs b/src/utils/question.rs index f8009ad..84b0fb9 100644 --- a/src/utils/question.rs +++ b/src/utils/question.rs @@ -60,8 +60,6 @@ pub fn create_or_ask_overwrite(path: &Path, question_policy: QuestionPolicy) -> Err(e) if e.kind() == std::io::ErrorKind::AlreadyExists => { if user_wants_to_overwrite(path, question_policy)? { if path.is_dir() { - // We can't just use `fs::File::create(&path)` because it would return io::ErrorKind::IsADirectory - // ToDo: Maybe we should emphasise that `path` is a directory and everything inside it will be gone? fs::remove_dir_all(path)?; } Ok(Some(fs::File::create(path)?))