style: cargo fmt --all, fix bzip2 error
This commit is contained in:
parent
3140276a33
commit
9af296d080
5 changed files with 8 additions and 9 deletions
|
@ -17,7 +17,7 @@ pub struct ExtendedTimestamp {
|
|||
impl ExtendedTimestamp {
|
||||
/// creates an extended timestamp struct by reading the required bytes from the reader.
|
||||
///
|
||||
/// This method assumes that the length has already been read, therefore
|
||||
/// This method assumes that the length has already been read, therefore
|
||||
/// it must be passed as an argument
|
||||
pub fn try_from_reader<R>(reader: &mut R, len: u16) -> ZipResult<Self>
|
||||
where
|
||||
|
|
|
@ -23,7 +23,6 @@ pub use extended_timestamp::*;
|
|||
/// contains one extra field
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum ExtraField {
|
||||
|
||||
/// extended timestamp, as described in <https://libzip.org/specifications/extrafld.txt>
|
||||
ExtendedTimestamp(ExtendedTimestamp)
|
||||
ExtendedTimestamp(ExtendedTimestamp),
|
||||
}
|
||||
|
|
|
@ -39,13 +39,13 @@ mod aes_ctr;
|
|||
mod compression;
|
||||
mod cp437;
|
||||
mod crc32;
|
||||
pub mod extra_fields;
|
||||
pub mod read;
|
||||
pub mod result;
|
||||
mod spec;
|
||||
mod types;
|
||||
pub mod write;
|
||||
mod zipcrypto;
|
||||
pub mod extra_fields;
|
||||
pub use extra_fields::ExtraField;
|
||||
|
||||
#[doc = "Unstable APIs\n\
|
||||
|
|
|
@ -30,7 +30,7 @@ use flate2::read::DeflateDecoder;
|
|||
use deflate64::Deflate64Decoder;
|
||||
|
||||
#[cfg(feature = "bzip2")]
|
||||
use bzip2::read::BzDecoder;
|
||||
use bzip2_rs::decoder::DecoderReader;
|
||||
|
||||
#[cfg(feature = "zstd")]
|
||||
use zstd::stream::read::Decoder as ZstdDecoder;
|
||||
|
@ -146,7 +146,7 @@ pub(crate) enum ZipFileReader<'a> {
|
|||
#[cfg(feature = "deflate64")]
|
||||
Deflate64(Crc32Reader<Deflate64Decoder<io::BufReader<CryptoReader<'a>>>>),
|
||||
#[cfg(feature = "bzip2")]
|
||||
Bzip2(Crc32Reader<BzDecoder<CryptoReader<'a>>>),
|
||||
Bzip2(Crc32Reader<DecoderReader<CryptoReader<'a>>>),
|
||||
#[cfg(feature = "zstd")]
|
||||
Zstd(Crc32Reader<ZstdDecoder<'a, io::BufReader<CryptoReader<'a>>>>),
|
||||
#[cfg(feature = "lzma")]
|
||||
|
@ -307,7 +307,7 @@ pub(crate) fn make_reader(
|
|||
}
|
||||
#[cfg(feature = "bzip2")]
|
||||
CompressionMethod::Bzip2 => {
|
||||
let bzip2_reader = BzDecoder::new(reader);
|
||||
let bzip2_reader = DecoderReader::new(reader);
|
||||
ZipFileReader::Bzip2(Crc32Reader::new(bzip2_reader, crc32, ae2_encrypted))
|
||||
}
|
||||
#[cfg(feature = "zstd")]
|
||||
|
@ -1102,7 +1102,7 @@ impl<'a> ZipFile<'a> {
|
|||
}
|
||||
|
||||
/// iterate through all extra fields
|
||||
pub fn extra_data_fields(&self) -> impl Iterator<Item=&ExtraField> {
|
||||
pub fn extra_data_fields(&self) -> impl Iterator<Item = &ExtraField> {
|
||||
self.data.extra_fields.iter()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ fn test_extended_timestamp() {
|
|||
assert!(ts.ac_time().is_none());
|
||||
assert!(ts.cr_time().is_none());
|
||||
assert_eq!(*ts.mod_time().unwrap(), 1714635025);
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue