| 1 | // Copyright Cognite AS, 2023 |
| 2 | |
| 3 | use craterust-analyzer cargo async_zip 0.0.18 crate/::errorrust-analyzer cargo async_zip 0.0.18 error/::{Resultrust-analyzer cargo async_zip 0.0.18 error/Result# as ZipResultrust-analyzer cargo async_zip 0.0.18 error/Result#, ZipErrorrust-analyzer cargo async_zip 0.0.18 error/ZipError#}; |
| 4 | use craterust-analyzer cargo async_zip 0.0.18 crate/::specrust-analyzer cargo async_zip 0.0.18 spec/::headerrust-analyzer cargo async_zip 0.0.18 spec/header/::{ |
| 5 | ExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/ExtraField#, HeaderIdrust-analyzer cargo async_zip 0.0.18 spec/header/HeaderId#, InfoZipUnicodeCommentExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodeCommentExtraField#, InfoZipUnicodePathExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodePathExtraField#, UnknownExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/UnknownExtraField#, |
| 6 | Zip64ExtendedInformationExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/Zip64ExtendedInformationExtraField#, |
| 7 | }; |
| 8 | |
| 9 | use superrust-analyzer cargo async_zip 0.0.18 spec/::constsrust-analyzer cargo async_zip 0.0.18 spec/consts/::NON_ZIP64_MAX_SIZErust-analyzer cargo async_zip 0.0.18 spec/consts/NON_ZIP64_MAX_SIZE.; |
| 10 | |
| 11 | pub(craterust-analyzer cargo async_zip 0.0.18 crate/) trait ExtraFieldAsBytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/ExtraFieldAsBytes# { |
| 12 | fn as_bytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/ExtraFieldAsBytes#as_bytes().(&self) -> Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u8>; |
| 13 | |
| 14 | fn count_bytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/ExtraFieldAsBytes#count_bytes().(&self) -> usize; |
| 15 | } |
| 16 | |
| 17 | impl ExtraFieldAsBytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/ExtraFieldAsBytes# for &[ExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/ExtraField#] { |
| 18 | fn as_bytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[`&[ExtraField]`][ExtraFieldAsBytes]as_bytes().(&self) -> Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u8> { |
| 19 | let mut buffer = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(); |
| 20 | for field in self.iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().() { |
| 21 | buffer.appendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]append().(&mut field.as_bytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[ExtraField][ExtraFieldAsBytes]as_bytes().()); |
| 22 | } |
| 23 | buffer |
| 24 | } |
| 25 | |
| 26 | fn count_bytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[`&[ExtraField]`][ExtraFieldAsBytes]count_bytes().(&self) -> usize { |
| 27 | self.iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|field| field.count_bytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[ExtraField][ExtraFieldAsBytes]count_bytes().()).sumrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#sum().() |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | impl ExtraFieldAsBytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/ExtraFieldAsBytes# for ExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/ExtraField# { |
| 32 | fn as_bytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[ExtraField][ExtraFieldAsBytes]as_bytes().(&self) -> Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u8> { |
| 33 | match self { |
| 34 | ExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/ExtraField#::Zip64ExtendedInformationrust-analyzer cargo async_zip 0.0.18 spec/header/ExtraField#Zip64ExtendedInformation#(field) => field.as_bytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[Zip64ExtendedInformationExtraField][ExtraFieldAsBytes]as_bytes().(), |
| 35 | ExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/ExtraField#::InfoZipUnicodeCommentrust-analyzer cargo async_zip 0.0.18 spec/header/ExtraField#InfoZipUnicodeComment#(field) => field.as_bytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[InfoZipUnicodeCommentExtraField][ExtraFieldAsBytes]as_bytes().(), |
| 36 | ExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/ExtraField#::InfoZipUnicodePathrust-analyzer cargo async_zip 0.0.18 spec/header/ExtraField#InfoZipUnicodePath#(field) => field.as_bytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[InfoZipUnicodePathExtraField][ExtraFieldAsBytes]as_bytes().(), |
| 37 | ExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/ExtraField#::Unknownrust-analyzer cargo async_zip 0.0.18 spec/header/ExtraField#Unknown#(field) => field.as_bytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[UnknownExtraField][ExtraFieldAsBytes]as_bytes().(), |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | fn count_bytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[ExtraField][ExtraFieldAsBytes]count_bytes().(&self) -> usize { |
| 42 | match self { |
| 43 | ExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/ExtraField#::Zip64ExtendedInformationrust-analyzer cargo async_zip 0.0.18 spec/header/ExtraField#Zip64ExtendedInformation#(field) => field.count_bytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[Zip64ExtendedInformationExtraField][ExtraFieldAsBytes]count_bytes().(), |
| 44 | ExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/ExtraField#::InfoZipUnicodeCommentrust-analyzer cargo async_zip 0.0.18 spec/header/ExtraField#InfoZipUnicodeComment#(field) => field.count_bytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[InfoZipUnicodeCommentExtraField][ExtraFieldAsBytes]count_bytes().(), |
| 45 | ExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/ExtraField#::InfoZipUnicodePathrust-analyzer cargo async_zip 0.0.18 spec/header/ExtraField#InfoZipUnicodePath#(field) => field.count_bytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[InfoZipUnicodePathExtraField][ExtraFieldAsBytes]count_bytes().(), |
| 46 | ExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/ExtraField#::Unknownrust-analyzer cargo async_zip 0.0.18 spec/header/ExtraField#Unknown#(field) => field.count_bytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[UnknownExtraField][ExtraFieldAsBytes]count_bytes().(), |
| 47 | } |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | impl ExtraFieldAsBytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/ExtraFieldAsBytes# for UnknownExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/UnknownExtraField# { |
| 52 | fn as_bytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[UnknownExtraField][ExtraFieldAsBytes]as_bytes().(&self) -> Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u8> { |
| 53 | let mut bytes = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(); |
| 54 | let header_id: u16 = self.header_idrust-analyzer cargo async_zip 0.0.18 spec/header/UnknownExtraField#header_id..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(); |
| 55 | bytes.appendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]append().(&mut header_id.to_le_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u16]to_le_bytes().().to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().()); |
| 56 | bytes.appendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]append().(&mut self.data_sizerust-analyzer cargo async_zip 0.0.18 spec/header/UnknownExtraField#data_size..to_le_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u16]to_le_bytes().().to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().()); |
| 57 | bytes.appendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]append().(&mut self.contentrust-analyzer cargo async_zip 0.0.18 spec/header/UnknownExtraField#content..clonerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][Clone]clone().()); |
| 58 | |
| 59 | bytes |
| 60 | } |
| 61 | |
| 62 | fn count_bytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[UnknownExtraField][ExtraFieldAsBytes]count_bytes().(&self) -> usize { |
| 63 | 4 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().self.contentrust-analyzer cargo async_zip 0.0.18 spec/header/UnknownExtraField#content..lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().() |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | impl ExtraFieldAsBytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/ExtraFieldAsBytes# for Zip64ExtendedInformationExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/Zip64ExtendedInformationExtraField# { |
| 68 | fn as_bytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[Zip64ExtendedInformationExtraField][ExtraFieldAsBytes]as_bytes().(&self) -> Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u8> { |
| 69 | let mut bytes = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(); |
| 70 | let header_id: u16 = self.header_idrust-analyzer cargo async_zip 0.0.18 spec/header/Zip64ExtendedInformationExtraField#header_id..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(); |
| 71 | bytes.appendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]append().(&mut header_id.to_le_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u16]to_le_bytes().().to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().()); |
| 72 | bytes.appendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]append().(&mut (self.content_sizerust-analyzer cargo async_zip 0.0.18 spec/header/impl#[Zip64ExtendedInformationExtraField]content_size().() as u16).to_le_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u16]to_le_bytes().().to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().()); |
| 73 | if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(uncompressed_size) = &self.uncompressed_sizerust-analyzer cargo async_zip 0.0.18 spec/header/Zip64ExtendedInformationExtraField#uncompressed_size. { |
| 74 | bytes.appendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]append().(&mut uncompressed_size.to_le_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u64]to_le_bytes().().to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().()); |
| 75 | } |
| 76 | if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(compressed_size) = &self.compressed_sizerust-analyzer cargo async_zip 0.0.18 spec/header/Zip64ExtendedInformationExtraField#compressed_size. { |
| 77 | bytes.appendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]append().(&mut compressed_size.to_le_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u64]to_le_bytes().().to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().()); |
| 78 | } |
| 79 | if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(relative_header_offset) = &self.relative_header_offsetrust-analyzer cargo async_zip 0.0.18 spec/header/Zip64ExtendedInformationExtraField#relative_header_offset. { |
| 80 | bytes.appendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]append().(&mut relative_header_offset.to_le_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u64]to_le_bytes().().to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().()); |
| 81 | } |
| 82 | if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(disk_start_number) = &self.disk_start_numberrust-analyzer cargo async_zip 0.0.18 spec/header/Zip64ExtendedInformationExtraField#disk_start_number. { |
| 83 | bytes.appendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]append().(&mut disk_start_number.to_le_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u32]to_le_bytes().().to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().()); |
| 84 | } |
| 85 | |
| 86 | bytes |
| 87 | } |
| 88 | |
| 89 | fn count_bytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[Zip64ExtendedInformationExtraField][ExtraFieldAsBytes]count_bytes().(&self) -> usize { |
| 90 | 4 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().self.content_sizerust-analyzer cargo async_zip 0.0.18 spec/header/impl#[Zip64ExtendedInformationExtraField]content_size().() |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | impl ExtraFieldAsBytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/ExtraFieldAsBytes# for InfoZipUnicodeCommentExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodeCommentExtraField# { |
| 95 | fn as_bytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[InfoZipUnicodeCommentExtraField][ExtraFieldAsBytes]as_bytes().(&self) -> Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u8> { |
| 96 | let mut bytes = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(); |
| 97 | let header_id: u16 = HeaderIdrust-analyzer cargo async_zip 0.0.18 spec/header/HeaderId#::INFO_ZIP_UNICODE_COMMENT_EXTRA_FIELDrust-analyzer cargo async_zip 0.0.18 spec/header/impl#[HeaderId]INFO_ZIP_UNICODE_COMMENT_EXTRA_FIELD..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(); |
| 98 | bytes.appendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]append().(&mut header_id.to_le_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u16]to_le_bytes().().to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().()); |
| 99 | match self { |
| 100 | InfoZipUnicodeCommentExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodeCommentExtraField#::V1rust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodeCommentExtraField#V1# { crc32rust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodeCommentExtraField#V1#crc32., unicoderust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodeCommentExtraField#V1#unicode. } => { |
| 101 | let data_size: u16 = (5 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().unicode.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().()).try_intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`TryInto<U>`]try_into().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 102 | bytes.appendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]append().(&mut data_size.to_le_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u16]to_le_bytes().().to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().()); |
| 103 | bytes.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(1); |
| 104 | bytes.appendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]append().(&mut crc32.to_le_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u32]to_le_bytes().().to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().()); |
| 105 | bytes.appendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]append().(&mut unicode.clonerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][Clone]clone().()); |
| 106 | } |
| 107 | InfoZipUnicodeCommentExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodeCommentExtraField#::Unknownrust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodeCommentExtraField#Unknown# { versionrust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodeCommentExtraField#Unknown#version., datarust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodeCommentExtraField#Unknown#data. } => { |
| 108 | let data_size: u16 = (1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().data.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().()).try_intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`TryInto<U>`]try_into().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 109 | bytes.appendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]append().(&mut data_size.to_le_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u16]to_le_bytes().().to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().()); |
| 110 | bytes.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().version); |
| 111 | bytes.appendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]append().(&mut data.clonerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][Clone]clone().()); |
| 112 | } |
| 113 | } |
| 114 | bytes |
| 115 | } |
| 116 | |
| 117 | fn count_bytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[InfoZipUnicodeCommentExtraField][ExtraFieldAsBytes]count_bytes().(&self) -> usize { |
| 118 | match self { |
| 119 | InfoZipUnicodeCommentExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodeCommentExtraField#::V1rust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodeCommentExtraField#V1# { unicoderust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodeCommentExtraField#V1#unicode., .. } => 9 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().unicode.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().(), |
| 120 | InfoZipUnicodeCommentExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodeCommentExtraField#::Unknownrust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodeCommentExtraField#Unknown# { datarust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodeCommentExtraField#Unknown#data., .. } => 5 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().data.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().(), |
| 121 | } |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | impl ExtraFieldAsBytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/ExtraFieldAsBytes# for InfoZipUnicodePathExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodePathExtraField# { |
| 126 | fn as_bytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[InfoZipUnicodePathExtraField][ExtraFieldAsBytes]as_bytes().(&self) -> Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u8> { |
| 127 | let mut bytes = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(); |
| 128 | let header_id: u16 = HeaderIdrust-analyzer cargo async_zip 0.0.18 spec/header/HeaderId#::INFO_ZIP_UNICODE_PATH_EXTRA_FIELDrust-analyzer cargo async_zip 0.0.18 spec/header/impl#[HeaderId]INFO_ZIP_UNICODE_PATH_EXTRA_FIELD..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(); |
| 129 | bytes.appendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]append().(&mut header_id.to_le_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u16]to_le_bytes().().to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().()); |
| 130 | match self { |
| 131 | InfoZipUnicodePathExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodePathExtraField#::V1rust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodePathExtraField#V1# { crc32rust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodePathExtraField#V1#crc32., unicoderust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodePathExtraField#V1#unicode. } => { |
| 132 | let data_size: u16 = (5 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().unicode.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().()).try_intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`TryInto<U>`]try_into().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 133 | bytes.appendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]append().(&mut data_size.to_le_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u16]to_le_bytes().().to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().()); |
| 134 | bytes.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(1); |
| 135 | bytes.appendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]append().(&mut crc32.to_le_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u32]to_le_bytes().().to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().()); |
| 136 | bytes.appendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]append().(&mut unicode.clonerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][Clone]clone().()); |
| 137 | } |
| 138 | InfoZipUnicodePathExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodePathExtraField#::Unknownrust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodePathExtraField#Unknown# { versionrust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodePathExtraField#Unknown#version., datarust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodePathExtraField#Unknown#data. } => { |
| 139 | let data_size: u16 = (1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().data.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().()).try_intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`TryInto<U>`]try_into().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 140 | bytes.appendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]append().(&mut data_size.to_le_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u16]to_le_bytes().().to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().()); |
| 141 | bytes.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().version); |
| 142 | bytes.appendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]append().(&mut data.clonerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][Clone]clone().()); |
| 143 | } |
| 144 | } |
| 145 | bytes |
| 146 | } |
| 147 | |
| 148 | fn count_bytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[InfoZipUnicodePathExtraField][ExtraFieldAsBytes]count_bytes().(&self) -> usize { |
| 149 | match self { |
| 150 | InfoZipUnicodePathExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodePathExtraField#::V1rust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodePathExtraField#V1# { unicoderust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodePathExtraField#V1#unicode., .. } => 9 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().unicode.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().(), |
| 151 | InfoZipUnicodePathExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodePathExtraField#::Unknownrust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodePathExtraField#Unknown# { datarust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodePathExtraField#Unknown#data., .. } => 5 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().data.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().(), |
| 152 | } |
| 153 | } |
| 154 | } |
| 155 | |
| 156 | /// Parse a zip64 extra field from bytes. |
| 157 | /// The content of "data" should exclude the header. |
| 158 | fn zip64_extended_information_field_from_bytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/zip64_extended_information_field_from_bytes().( |
| 159 | header_id: HeaderIdrust-analyzer cargo async_zip 0.0.18 spec/header/HeaderId#, |
| 160 | data: &[u8], |
| 161 | uncompressed_size: u32, |
| 162 | compressed_size: u32, |
| 163 | ) -> ZipResultrust-analyzer cargo async_zip 0.0.18 error/Result#<Zip64ExtendedInformationExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/Zip64ExtendedInformationExtraField#> { |
| 164 | // slice.take is nightly-only so we'll just use an index to track the current position |
| 165 | let mut current_idx = 0; |
| 166 | let uncompressed_size = if uncompressed_size rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq().NON_ZIP64_MAX_SIZErust-analyzer cargo async_zip 0.0.18 spec/consts/NON_ZIP64_MAX_SIZE. && data.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().current_idx rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().8 { |
| 167 | let val = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(u64::from_le_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u64]from_le_bytes().(data[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().current_idx..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#current_idx rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..try_intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/TryInto#try_into().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().())); |
| 168 | current_idx rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().8; |
| 169 | val |
| 170 | } else { |
| 171 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# |
| 172 | }; |
| 173 | |
| 174 | let compressed_size = if compressed_size rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq().NON_ZIP64_MAX_SIZErust-analyzer cargo async_zip 0.0.18 spec/consts/NON_ZIP64_MAX_SIZE. && data.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().current_idx rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().8 { |
| 175 | let val = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(u64::from_le_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u64]from_le_bytes().(data[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().current_idx..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#current_idx rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..try_intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/TryInto#try_into().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().())); |
| 176 | current_idx rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().8; |
| 177 | val |
| 178 | } else { |
| 179 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# |
| 180 | }; |
| 181 | |
| 182 | let relative_header_offset = if data.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().current_idx rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().8 { |
| 183 | let val = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(u64::from_le_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u64]from_le_bytes().(data[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().current_idx..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#current_idx rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..try_intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/TryInto#try_into().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().())); |
| 184 | current_idx rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().8; |
| 185 | val |
| 186 | } else { |
| 187 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# |
| 188 | }; |
| 189 | |
| 190 | #[allow(unused_assignments)] |
| 191 | let disk_start_number = if data.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().current_idx rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().4 { |
| 192 | let val = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(u32::from_le_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u32]from_le_bytes().(data[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().current_idx..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#current_idx rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().4]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..try_intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/TryInto#try_into().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().())); |
| 193 | current_idx rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().4; |
| 194 | val |
| 195 | } else { |
| 196 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# |
| 197 | }; |
| 198 | |
| 199 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Zip64ExtendedInformationExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/Zip64ExtendedInformationExtraField# { |
| 200 | header_idrust-analyzer cargo async_zip 0.0.18 spec/header/Zip64ExtendedInformationExtraField#header_id., |
| 201 | uncompressed_sizerust-analyzer cargo async_zip 0.0.18 spec/header/Zip64ExtendedInformationExtraField#uncompressed_size., |
| 202 | compressed_sizerust-analyzer cargo async_zip 0.0.18 spec/header/Zip64ExtendedInformationExtraField#compressed_size., |
| 203 | relative_header_offsetrust-analyzer cargo async_zip 0.0.18 spec/header/Zip64ExtendedInformationExtraField#relative_header_offset., |
| 204 | disk_start_numberrust-analyzer cargo async_zip 0.0.18 spec/header/Zip64ExtendedInformationExtraField#disk_start_number., |
| 205 | }) |
| 206 | } |
| 207 | |
| 208 | fn info_zip_unicode_comment_extra_field_from_bytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/info_zip_unicode_comment_extra_field_from_bytes().( |
| 209 | _header_id: HeaderIdrust-analyzer cargo async_zip 0.0.18 spec/header/HeaderId#, |
| 210 | data_size: u16, |
| 211 | data: &[u8], |
| 212 | ) -> ZipResultrust-analyzer cargo async_zip 0.0.18 error/Result#<InfoZipUnicodeCommentExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodeCommentExtraField#> { |
| 213 | if data.is_emptyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]is_empty().() { |
| 214 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(ZipErrorrust-analyzer cargo async_zip 0.0.18 error/ZipError#::InfoZipUnicodeCommentFieldIncompleterust-analyzer cargo async_zip 0.0.18 error/ZipError#InfoZipUnicodeCommentFieldIncomplete#); |
| 215 | } |
| 216 | let version = data[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().; |
| 217 | match version { |
| 218 | 1 => { |
| 219 | if data.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().5 { |
| 220 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(ZipErrorrust-analyzer cargo async_zip 0.0.18 error/ZipError#::InfoZipUnicodeCommentFieldIncompleterust-analyzer cargo async_zip 0.0.18 error/ZipError#InfoZipUnicodeCommentFieldIncomplete#); |
| 221 | } |
| 222 | let crc32 = u32::from_le_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u32]from_le_bytes().(data[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().1..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#5]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..try_intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/TryInto#try_into().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().()); |
| 223 | let unicode = data[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().5..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#(data_size as usize)]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().(); |
| 224 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(InfoZipUnicodeCommentExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodeCommentExtraField#::V1rust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodeCommentExtraField#V1# { crc32rust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodeCommentExtraField#V1#crc32., unicoderust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodeCommentExtraField#V1#unicode. }) |
| 225 | } |
| 226 | _ => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(InfoZipUnicodeCommentExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodeCommentExtraField#::Unknownrust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodeCommentExtraField#Unknown# { versionrust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodeCommentExtraField#Unknown#version., datarust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodeCommentExtraField#Unknown#data.: data[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().1..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#(data_size as usize)]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().() }), |
| 227 | } |
| 228 | } |
| 229 | |
| 230 | fn info_zip_unicode_path_extra_field_from_bytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/info_zip_unicode_path_extra_field_from_bytes().( |
| 231 | _header_id: HeaderIdrust-analyzer cargo async_zip 0.0.18 spec/header/HeaderId#, |
| 232 | data_size: u16, |
| 233 | data: &[u8], |
| 234 | ) -> ZipResultrust-analyzer cargo async_zip 0.0.18 error/Result#<InfoZipUnicodePathExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodePathExtraField#> { |
| 235 | if data.is_emptyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]is_empty().() { |
| 236 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(ZipErrorrust-analyzer cargo async_zip 0.0.18 error/ZipError#::InfoZipUnicodePathFieldIncompleterust-analyzer cargo async_zip 0.0.18 error/ZipError#InfoZipUnicodePathFieldIncomplete#); |
| 237 | } |
| 238 | let version = data[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().; |
| 239 | match version { |
| 240 | 1 => { |
| 241 | if data.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().5 { |
| 242 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(ZipErrorrust-analyzer cargo async_zip 0.0.18 error/ZipError#::InfoZipUnicodePathFieldIncompleterust-analyzer cargo async_zip 0.0.18 error/ZipError#InfoZipUnicodePathFieldIncomplete#); |
| 243 | } |
| 244 | let crc32 = u32::from_le_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u32]from_le_bytes().(data[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().1..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#5]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..try_intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/TryInto#try_into().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().()); |
| 245 | let unicode = data[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().5..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#(data_size as usize)]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().(); |
| 246 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(InfoZipUnicodePathExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodePathExtraField#::V1rust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodePathExtraField#V1# { crc32rust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodePathExtraField#V1#crc32., unicoderust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodePathExtraField#V1#unicode. }) |
| 247 | } |
| 248 | _ => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(InfoZipUnicodePathExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodePathExtraField#::Unknownrust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodePathExtraField#Unknown# { versionrust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodePathExtraField#Unknown#version., datarust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodePathExtraField#Unknown#data.: data[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().1..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#(data_size as usize)]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().() }), |
| 249 | } |
| 250 | } |
| 251 | |
| 252 | pub(craterust-analyzer cargo async_zip 0.0.18 crate/) fn extra_field_from_bytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/extra_field_from_bytes().( |
| 253 | header_id: HeaderIdrust-analyzer cargo async_zip 0.0.18 spec/header/HeaderId#, |
| 254 | data_size: u16, |
| 255 | data: &[u8], |
| 256 | uncompressed_size: u32, |
| 257 | compressed_size: u32, |
| 258 | ) -> ZipResultrust-analyzer cargo async_zip 0.0.18 error/Result#<ExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/ExtraField#> { |
| 259 | match header_id { |
| 260 | HeaderIdrust-analyzer cargo async_zip 0.0.18 spec/header/HeaderId#::ZIP64_EXTENDED_INFORMATION_EXTRA_FIELDrust-analyzer cargo async_zip 0.0.18 spec/header/impl#[HeaderId]ZIP64_EXTENDED_INFORMATION_EXTRA_FIELD. => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(ExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/ExtraField#::Zip64ExtendedInformationrust-analyzer cargo async_zip 0.0.18 spec/header/ExtraField#Zip64ExtendedInformation#( |
| 261 | zip64_extended_information_field_from_bytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/zip64_extended_information_field_from_bytes().(header_id, data, uncompressed_size, compressed_size)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., |
| 262 | )), |
| 263 | HeaderIdrust-analyzer cargo async_zip 0.0.18 spec/header/HeaderId#::INFO_ZIP_UNICODE_COMMENT_EXTRA_FIELDrust-analyzer cargo async_zip 0.0.18 spec/header/impl#[HeaderId]INFO_ZIP_UNICODE_COMMENT_EXTRA_FIELD. => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(ExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/ExtraField#::InfoZipUnicodeCommentrust-analyzer cargo async_zip 0.0.18 spec/header/ExtraField#InfoZipUnicodeComment#( |
| 264 | info_zip_unicode_comment_extra_field_from_bytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/info_zip_unicode_comment_extra_field_from_bytes().(header_id, data_size, data)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., |
| 265 | )), |
| 266 | HeaderIdrust-analyzer cargo async_zip 0.0.18 spec/header/HeaderId#::INFO_ZIP_UNICODE_PATH_EXTRA_FIELDrust-analyzer cargo async_zip 0.0.18 spec/header/impl#[HeaderId]INFO_ZIP_UNICODE_PATH_EXTRA_FIELD. => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(ExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/ExtraField#::InfoZipUnicodePathrust-analyzer cargo async_zip 0.0.18 spec/header/ExtraField#InfoZipUnicodePath#( |
| 267 | info_zip_unicode_path_extra_field_from_bytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/info_zip_unicode_path_extra_field_from_bytes().(header_id, data_size, data)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., |
| 268 | )), |
| 269 | _ => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(ExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/ExtraField#::Unknownrust-analyzer cargo async_zip 0.0.18 spec/header/ExtraField#Unknown#(UnknownExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/UnknownExtraField# { header_idrust-analyzer cargo async_zip 0.0.18 spec/header/UnknownExtraField#header_id., data_sizerust-analyzer cargo async_zip 0.0.18 spec/header/UnknownExtraField#data_size., contentrust-analyzer cargo async_zip 0.0.18 spec/header/UnknownExtraField#content.: data.to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().() })), |
| 270 | } |
| 271 | } |
| 272 | |
| 273 | pub struct Zip64ExtendedInformationExtraFieldBuilderrust-analyzer cargo async_zip 0.0.18 spec/extra_field/Zip64ExtendedInformationExtraFieldBuilder# { |
| 274 | fieldrust-analyzer cargo async_zip 0.0.18 spec/extra_field/Zip64ExtendedInformationExtraFieldBuilder#field.: Zip64ExtendedInformationExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/Zip64ExtendedInformationExtraField#, |
| 275 | } |
| 276 | |
| 277 | impl Zip64ExtendedInformationExtraFieldBuilderrust-analyzer cargo async_zip 0.0.18 spec/extra_field/Zip64ExtendedInformationExtraFieldBuilder# { |
| 278 | pub fn newrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[Zip64ExtendedInformationExtraFieldBuilder]new().() -> Selfrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[Zip64ExtendedInformationExtraFieldBuilder] { |
| 279 | Selfrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[Zip64ExtendedInformationExtraFieldBuilder] { |
| 280 | fieldrust-analyzer cargo async_zip 0.0.18 spec/extra_field/Zip64ExtendedInformationExtraFieldBuilder#field.: Zip64ExtendedInformationExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/Zip64ExtendedInformationExtraField# { |
| 281 | header_idrust-analyzer cargo async_zip 0.0.18 spec/header/Zip64ExtendedInformationExtraField#header_id.: HeaderIdrust-analyzer cargo async_zip 0.0.18 spec/header/HeaderId#::ZIP64_EXTENDED_INFORMATION_EXTRA_FIELDrust-analyzer cargo async_zip 0.0.18 spec/header/impl#[HeaderId]ZIP64_EXTENDED_INFORMATION_EXTRA_FIELD., |
| 282 | uncompressed_sizerust-analyzer cargo async_zip 0.0.18 spec/header/Zip64ExtendedInformationExtraField#uncompressed_size.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 283 | compressed_sizerust-analyzer cargo async_zip 0.0.18 spec/header/Zip64ExtendedInformationExtraField#compressed_size.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 284 | relative_header_offsetrust-analyzer cargo async_zip 0.0.18 spec/header/Zip64ExtendedInformationExtraField#relative_header_offset.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 285 | disk_start_numberrust-analyzer cargo async_zip 0.0.18 spec/header/Zip64ExtendedInformationExtraField#disk_start_number.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 286 | }, |
| 287 | } |
| 288 | } |
| 289 | |
| 290 | pub fn sizesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[Zip64ExtendedInformationExtraFieldBuilder]sizes().(mut self, compressed_size: u64, uncompressed_size: u64) -> Selfrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[Zip64ExtendedInformationExtraFieldBuilder] { |
| 291 | self.fieldrust-analyzer cargo async_zip 0.0.18 spec/extra_field/Zip64ExtendedInformationExtraFieldBuilder#field..compressed_sizerust-analyzer cargo async_zip 0.0.18 spec/header/Zip64ExtendedInformationExtraField#compressed_size. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(compressed_size); |
| 292 | self.fieldrust-analyzer cargo async_zip 0.0.18 spec/extra_field/Zip64ExtendedInformationExtraFieldBuilder#field..uncompressed_sizerust-analyzer cargo async_zip 0.0.18 spec/header/Zip64ExtendedInformationExtraField#uncompressed_size. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(uncompressed_size); |
| 293 | self |
| 294 | } |
| 295 | |
| 296 | pub fn relative_header_offsetrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[Zip64ExtendedInformationExtraFieldBuilder]relative_header_offset().(mut self, relative_header_offset: u64) -> Selfrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[Zip64ExtendedInformationExtraFieldBuilder] { |
| 297 | self.fieldrust-analyzer cargo async_zip 0.0.18 spec/extra_field/Zip64ExtendedInformationExtraFieldBuilder#field..relative_header_offsetrust-analyzer cargo async_zip 0.0.18 spec/header/Zip64ExtendedInformationExtraField#relative_header_offset. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(relative_header_offset); |
| 298 | self |
| 299 | } |
| 300 | |
| 301 | #[allow(dead_code)] |
| 302 | pub fn disk_start_numberrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[Zip64ExtendedInformationExtraFieldBuilder]disk_start_number().(mut self, disk_start_number: u32) -> Selfrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[Zip64ExtendedInformationExtraFieldBuilder] { |
| 303 | self.fieldrust-analyzer cargo async_zip 0.0.18 spec/extra_field/Zip64ExtendedInformationExtraFieldBuilder#field..disk_start_numberrust-analyzer cargo async_zip 0.0.18 spec/header/Zip64ExtendedInformationExtraField#disk_start_number. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(disk_start_number); |
| 304 | self |
| 305 | } |
| 306 | |
| 307 | pub fn eof_onlyrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[Zip64ExtendedInformationExtraFieldBuilder]eof_only().(&self) -> bool { |
| 308 | (self.fieldrust-analyzer cargo async_zip 0.0.18 spec/extra_field/Zip64ExtendedInformationExtraFieldBuilder#field..uncompressed_sizerust-analyzer cargo async_zip 0.0.18 spec/header/Zip64ExtendedInformationExtraField#uncompressed_size..is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().() && self.fieldrust-analyzer cargo async_zip 0.0.18 spec/extra_field/Zip64ExtendedInformationExtraFieldBuilder#field..compressed_sizerust-analyzer cargo async_zip 0.0.18 spec/header/Zip64ExtendedInformationExtraField#compressed_size..is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().()) |
| 309 | && (self.fieldrust-analyzer cargo async_zip 0.0.18 spec/extra_field/Zip64ExtendedInformationExtraFieldBuilder#field..relative_header_offsetrust-analyzer cargo async_zip 0.0.18 spec/header/Zip64ExtendedInformationExtraField#relative_header_offset..is_somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_some().() || self.fieldrust-analyzer cargo async_zip 0.0.18 spec/extra_field/Zip64ExtendedInformationExtraFieldBuilder#field..disk_start_numberrust-analyzer cargo async_zip 0.0.18 spec/header/Zip64ExtendedInformationExtraField#disk_start_number..is_somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_some().()) |
| 310 | } |
| 311 | |
| 312 | pub fn buildrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[Zip64ExtendedInformationExtraFieldBuilder]build().(self) -> ZipResultrust-analyzer cargo async_zip 0.0.18 error/Result#<Zip64ExtendedInformationExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/Zip64ExtendedInformationExtraField#> { |
| 313 | let field = self.fieldrust-analyzer cargo async_zip 0.0.18 spec/extra_field/Zip64ExtendedInformationExtraFieldBuilder#field.; |
| 314 | |
| 315 | if field.content_sizerust-analyzer cargo async_zip 0.0.18 spec/header/impl#[Zip64ExtendedInformationExtraField]content_size().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().0 { |
| 316 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(ZipErrorrust-analyzer cargo async_zip 0.0.18 error/ZipError#::Zip64ExtendedFieldIncompleterust-analyzer cargo async_zip 0.0.18 error/ZipError#Zip64ExtendedFieldIncomplete#); |
| 317 | } |
| 318 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(field) |
| 319 | } |
| 320 | } |