From b31f40701195c0e6c6343cf02fb86299c7c62a96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20M=2E=20Bezerra?= Date: Wed, 24 Nov 2021 23:45:12 -0300 Subject: [PATCH] Reformat code --- src/archive/zip.rs | 30 +++++++++++++++--------------- src/error.rs | 18 +++++++++--------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/archive/zip.rs b/src/archive/zip.rs index 4962933..a9af1df 100644 --- a/src/archive/zip.rs +++ b/src/archive/zip.rs @@ -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)?; } @@ -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)?; @@ -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); } } diff --git a/src/error.rs b/src/error.rs index 550def2..b8a7ddb 100644 --- a/src/error.rs +++ b/src/error.rs @@ -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(())