Reformat code

This commit is contained in:
João M. Bezerra 2021-11-24 23:45:12 -03:00
parent 4e0dbeb85b
commit b31f407011
2 changed files with 24 additions and 24 deletions

View File

@ -48,10 +48,10 @@ where
match (&*file.name()).ends_with('/') { match (&*file.name()).ends_with('/') {
_is_dir @ true => { _is_dir @ true => {
// This is printed for every file in the archive and has little // This is printed for every file in the archive and has little
// importance for most users, but would generate lots of // importance for most users, but would generate lots of
// spoken text for users using screen readers, braille displays // spoken text for users using screen readers, braille displays
// and so on // and so on
info!(inaccessible, "File {} extracted to \"{}\"", idx, file_path.display()); info!(inaccessible, "File {} extracted to \"{}\"", idx, file_path.display());
fs::create_dir_all(&file_path)?; fs::create_dir_all(&file_path)?;
} }
@ -63,7 +63,7 @@ where
} }
let file_path = strip_cur_dir(file_path.as_path()); let file_path = strip_cur_dir(file_path.as_path());
// same reason is in _is_dir: long, often not needed text // same reason is in _is_dir: long, often not needed text
info!(inaccessible, "{:?} extracted. ({})", file_path.display(), Bytes::new(file.size())); info!(inaccessible, "{:?} extracted. ({})", file_path.display(), Bytes::new(file.size()));
let mut output_file = fs::File::create(&file_path)?; let mut output_file = fs::File::create(&file_path)?;
@ -158,16 +158,16 @@ where
fn check_for_comments(file: &ZipFile) { fn check_for_comments(file: &ZipFile) {
let comment = file.comment(); let comment = file.comment();
if !comment.is_empty() { if !comment.is_empty() {
// Zip file comments seem to be pretty rare, but if they are used, // Zip file comments seem to be pretty rare, but if they are used,
// they may contain important information, so better show them // they may contain important information, so better show them
// //
// "The .ZIP file format allows for a comment containing up to 65,535 (2161) bytes // "The .ZIP file format allows for a comment containing up to 65,535 (2161) bytes
// of data to occur at the end of the file after the central directory." // of data to occur at the end of the file after the central directory."
// //
// If there happen to be cases of very long and unnecessary comments in // If there happen to be cases of very long and unnecessary comments in
// the future, maybe asking the user if he wants to display the comment // the future, maybe asking the user if he wants to display the comment
// (informing him of its size) would be sensible for both normal and // (informing him of its size) would be sensible for both normal and
// accessibility mode.. // accessibility mode..
info!(accessible, "Found comment in {}: {}", file.name(), comment); info!(accessible, "Found comment in {}: {}", file.name(), comment);
} }
} }

View File

@ -68,16 +68,16 @@ impl Display for FinalError {
writeln!(f)?; writeln!(f)?;
// to reduce redundant output for text-to-speach systems, braille // to reduce redundant output for text-to-speach systems, braille
// displays and so on, only print "hints" once in ACCESSIBLE mode // displays and so on, only print "hints" once in ACCESSIBLE mode
if *crate::cli::ACCESSIBLE.get().unwrap_or(&false) { if *crate::cli::ACCESSIBLE.get().unwrap_or(&false) {
write!(f, "\n{}hints:{}", *GREEN, *RESET)?; write!(f, "\n{}hints:{}", *GREEN, *RESET)?;
for hint in &self.hints { for hint in &self.hints {
write!(f, "\n{}", hint)?; write!(f, "\n{}", hint)?;
} }
} else { } else {
for hint in &self.hints { for hint in &self.hints {
write!(f, "\n{}hint:{} {}", *GREEN, *RESET, hint)?; write!(f, "\n{}hint:{} {}", *GREEN, *RESET, hint)?;
} }
} }
} }
Ok(()) Ok(())