| 1 | // Copyright (c) 2021 Harry [Majored] [[email protected]] |
| 2 | // MIT License (https://github.com/Majored/rs-async-zip/blob/main/LICENSE) |
| 3 | |
| 4 | use craterust-analyzer cargo async_zip 0.0.18 crate/::entryrust-analyzer cargo async_zip 0.0.18 entry/::ZipEntryrust-analyzer cargo async_zip 0.0.18 entry/ZipEntry#; |
| 5 | #[cfg(any( |
| 6 | feature = "deflate", |
| 7 | feature = "bzip2", |
| 8 | feature = "zstd", |
| 9 | feature = "lzma", |
| 10 | feature = "xz", |
| 11 | feature = "deflate64" |
| 12 | ))] |
| 13 | use craterust-analyzer cargo async_zip 0.0.18 crate/::specrust-analyzer cargo async_zip 0.0.18 spec/::Compressionrust-analyzer cargo async_zip 0.0.18 spec/compression/Compression#; |
| 14 | |
| 15 | pub(craterust-analyzer cargo async_zip 0.0.18 crate/) const SPEC_VERSION_MADE_BYrust-analyzer cargo async_zip 0.0.18 spec/version/SPEC_VERSION_MADE_BY.: u16 = 63; |
| 16 | |
| 17 | // https://github.com/Majored/rs-async-zip/blob/main/SPECIFICATION.md#443 |
| 18 | pub fn as_needed_to_extractrust-analyzer cargo async_zip 0.0.18 spec/version/as_needed_to_extract().(entry: &ZipEntryrust-analyzer cargo async_zip 0.0.18 entry/ZipEntry#) -> u16 { |
| 19 | let mut version = match entry.compressionrust-analyzer cargo async_zip 0.0.18 entry/impl#[ZipEntry]compression().() { |
| 20 | #[cfg(feature = "deflate")] |
| 21 | Compressionrust-analyzer cargo async_zip 0.0.18 spec/compression/Compression#::Deflaterust-analyzer cargo async_zip 0.0.18 spec/compression/Compression#Deflate# => 20, |
| 22 | #[cfg(feature = "deflate64")] |
| 23 | Compressionrust-analyzer cargo async_zip 0.0.18 spec/compression/Compression#::Deflate64 => 21, |
| 24 | #[cfg(feature = "bzip2")] |
| 25 | Compressionrust-analyzer cargo async_zip 0.0.18 spec/compression/Compression#::Bzrust-analyzer cargo async_zip 0.0.18 spec/compression/Compression#Bz# => 46, |
| 26 | #[cfg(feature = "lzma")] |
| 27 | Compressionrust-analyzer cargo async_zip 0.0.18 spec/compression/Compression#::Lzmarust-analyzer cargo async_zip 0.0.18 spec/compression/Compression#Lzma# => 63, |
| 28 | _ => 10, |
| 29 | }; |
| 30 | |
| 31 | if let Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(true) = entry.dirrust-analyzer cargo async_zip 0.0.18 entry/impl#[ZipEntry]dir().() { |
| 32 | version = stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::cmprust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/::maxrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/max().(version, 20); |
| 33 | } |
| 34 | |
| 35 | version |
| 36 | } |
| 37 | |
| 38 | // https://github.com/Majored/rs-async-zip/blob/main/SPECIFICATION.md#442 |
| 39 | pub fn as_made_byrust-analyzer cargo async_zip 0.0.18 spec/version/as_made_by().() -> u16 { |
| 40 | // Default to UNIX mapping for the moment. |
| 41 | 3 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shl<i32>`]shl().<<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shl<i32>`]shl(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shl<i32>`]shl().8 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor().|rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor().SPEC_VERSION_MADE_BYrust-analyzer cargo async_zip 0.0.18 spec/version/SPEC_VERSION_MADE_BY. |
| 42 | } |