Skip to content

Commit

Permalink
run cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Lireer committed Jan 25, 2022
1 parent 35d8f04 commit 3a71893
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/aes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ pub struct AesReaderValid<R: Read> {

impl<R: Read> Read for AesReaderValid<R> {
/// This implementation does not fulfill all requirements set in the trait documentation.
///
///
/// ```txt
/// "If an error is returned then it must be guaranteed that no bytes were read."
/// ```
///
///
/// Whether this applies to errors that occur while reading the encrypted data depends on the
/// underlying reader. If the error occurs while verifying the HMAC, the reader might become
/// practically unusable, since its position after the error is not known.
Expand Down
2 changes: 1 addition & 1 deletion src/compression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub enum CompressionMethod {
#[cfg(feature = "bzip2")]
Bzip2,
/// Encrypted using AES.
///
///
/// The actual compression method has to be taken from the AES extra data field
/// or from `ZipFileData`.
Aes,
Expand Down
8 changes: 7 additions & 1 deletion src/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,13 @@ impl<'a> CryptoReader<'a> {
/// Returns `true` if the data is encrypted using AE2.
pub fn is_ae2_encrypted(&self) -> bool {
#[cfg(feature = "aes-crypto")]
return matches!(self, CryptoReader::Aes { vendor_version: AesVendorVersion::Ae2, .. });
return matches!(
self,
CryptoReader::Aes {
vendor_version: AesVendorVersion::Ae2,
..
}
);
#[cfg(not(feature = "aes-crypto"))]
false
}
Expand Down

0 comments on commit 3a71893

Please sign in to comment.