Skip to content

Commit

Permalink
Reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
marcospb19 committed Nov 25, 2021
1 parent 4e0dbeb commit b31f407
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
30 changes: 15 additions & 15 deletions src/archive/zip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ where

match (&*file.name()).ends_with('/') {
_is_dir @ true => {
// This is printed for every file in the archive and has little
// importance for most users, but would generate lots of
// spoken text for users using screen readers, braille displays
// and so on
// This is printed for every file in the archive and has little
// importance for most users, but would generate lots of
// spoken text for users using screen readers, braille displays
// and so on
info!(inaccessible, "File {} extracted to \"{}\"", idx, file_path.display());
fs::create_dir_all(&file_path)?;
}
Expand All @@ -63,7 +63,7 @@ where
}
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()));

let mut output_file = fs::File::create(&file_path)?;
Expand Down Expand Up @@ -158,16 +158,16 @@ where
fn check_for_comments(file: &ZipFile) {
let comment = file.comment();
if !comment.is_empty() {
// Zip file comments seem to be pretty rare, but if they are used,
// they may contain important information, so better show them
//
// "The .ZIP file format allows for a comment containing up to 65,535 (216−1) bytes
// 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
// 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
// accessibility mode..
// Zip file comments seem to be pretty rare, but if they are used,
// they may contain important information, so better show them
//
// "The .ZIP file format allows for a comment containing up to 65,535 (216−1) bytes
// 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
// 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
// accessibility mode..
info!(accessible, "Found comment in {}: {}", file.name(), comment);
}
}
Expand Down
18 changes: 9 additions & 9 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,16 @@ impl Display for FinalError {
writeln!(f)?;
// to reduce redundant output for text-to-speach systems, braille
// 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)?;
for hint in &self.hints {
write!(f, "\n{}", hint)?;
}
} else {
for hint in &self.hints {
write!(f, "\n{}hint:{} {}", *GREEN, *RESET, hint)?;
}
}
for hint in &self.hints {
write!(f, "\n{}", hint)?;
}
} else {
for hint in &self.hints {
write!(f, "\n{}hint:{} {}", *GREEN, *RESET, hint)?;
}
}
}

Ok(())
Expand Down

0 comments on commit b31f407

Please sign in to comment.