Skip to content

Commit 16c23c0

Browse files
fix compile after prolonged absence
1 parent a416ddc commit 16c23c0

File tree

8 files changed

+19
-17
lines changed

8 files changed

+19
-17
lines changed

cli/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ chrono = ["zip/chrono"]
3939
deflate64 = ["zip/deflate64"]
4040
deflate = ["zip/deflate"]
4141
deflate-flate2 = ["zip/deflate-flate2"]
42-
deflate-zlib = ["zip/deflate-zlib"]
43-
deflate-zlib-ng = ["zip/deflate-zlib-ng"]
42+
deflate-flate2-zlib-rs = ["zip/deflate-flate2-zlib-rs"]
43+
deflate-flate2-zlib = ["zip/deflate-flate2-zlib"]
4444
deflate-zopfli = ["zip/deflate-zopfli"]
4545
lzma = ["zip/lzma"]
4646
time = ["zip/time"]

cli/clite/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ path = ".."
2626
default-features = false
2727
features = [
2828
"deflate-flate2",
29-
"deflate-zlib",
29+
"deflate-flate2-zlib-rs",
3030
]
3131

3232
[features]

cli/src/extract.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use entries::{IterateEntries, StreamInput, ZipFileInput};
1919
use receiver::{CompiledEntrySpec, EntryData, EntryKind, EntryReceiver, ExtractEntry};
2020

2121
fn maybe_process_symlink<'a, 't>(
22-
entry: &mut ZipFile<'a>,
22+
entry: &mut ZipFile<'a, impl Read>,
2323
err: &Rc<RefCell<impl Write>>,
2424
symlink_target: &'t mut Vec<u8>,
2525
) -> Result<Option<&'t mut [u8]>, CommandError> {
@@ -54,7 +54,7 @@ fn maybe_process_symlink<'a, 't>(
5454
}
5555

5656
fn process_entry<'a, 'w, 'c, 'it>(
57-
mut entry: ZipFile<'a>,
57+
mut entry: ZipFile<'a, impl Read>,
5858
err: &Rc<RefCell<impl Write>>,
5959
compiled_specs: impl Iterator<Item = &'it CompiledEntrySpec<'w>>,
6060
copy_buf: &mut [u8],

cli/src/extract/entries.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ use zip::{
77

88
use crate::{CommandError, WrapCommandErr};
99

10-
pub trait IterateEntries {
11-
fn next_entry(&mut self) -> Result<Option<ZipFile>, CommandError>;
10+
pub trait IterateEntries<R: io::Read> {
11+
fn next_entry(&mut self) -> Result<Option<ZipFile<R>>, CommandError>;
1212
}
1313

1414
pub struct ReadChecker<R> {
@@ -70,11 +70,11 @@ impl<R> StreamInput<R> {
7070
}
7171
}
7272

73-
impl<R> IterateEntries for StreamInput<R>
73+
impl<R> IterateEntries<ReadChecker<R>> for StreamInput<R>
7474
where
7575
R: io::Read,
7676
{
77-
fn next_entry(&mut self) -> Result<Option<ZipFile>, CommandError> {
77+
fn next_entry(&mut self) -> Result<Option<ZipFile<ReadChecker<R>>>, CommandError> {
7878
if let Some(entry) = read_zipfile_from_stream(&mut self.inner)
7979
.wrap_err("failed to read zip entries from stdin")?
8080
{
@@ -114,11 +114,11 @@ where
114114
}
115115
}
116116

117-
impl<A> IterateEntries for ZipFileInput<A>
117+
impl<A> IterateEntries<fs::File> for ZipFileInput<A>
118118
where
119119
A: ops::DerefMut<Target = ZipArchive<fs::File>>,
120120
{
121-
fn next_entry(&mut self) -> Result<Option<ZipFile>, CommandError> {
121+
fn next_entry(&mut self) -> Result<Option<ZipFile<fs::File>>, CommandError> {
122122
if self.none_left() {
123123
return Ok(None);
124124
}

cli/src/extract/receiver.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::{
22
borrow::Cow,
33
cell::RefCell,
44
fmt, fs,
5-
io::{self, Write},
5+
io::{self, Read, Write},
66
mem,
77
path::{Path, PathBuf},
88
rc::Rc,
@@ -44,7 +44,7 @@ pub struct EntryData<'a> {
4444

4545
impl<'a> EntryData<'a> {
4646
#[inline(always)]
47-
pub fn from_entry<'b>(entry: &'a ZipFile<'b>) -> Self {
47+
pub fn from_entry<'b>(entry: &'a ZipFile<'b, impl Read>) -> Self {
4848
Self {
4949
name: entry.name(),
5050
kind: if entry.is_dir() {
@@ -68,6 +68,7 @@ impl<'a> EntryData<'a> {
6868
.extra_data_fields()
6969
.find_map(|f| match f {
7070
ExtraField::ExtendedTimestamp(ts) => Some(ts),
71+
ExtraField::Ntfs(_) => todo!(),
7172
})
7273
.cloned(),
7374
}

cli/src/info.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::{
22
fs,
3-
io::{self, Write},
3+
io::{self, Read, Write},
44
path::PathBuf,
55
};
66

@@ -47,12 +47,12 @@ impl ArchiveWithPath {
4747
}
4848
}
4949

50-
fn format_entry_info(
50+
fn format_entry_info<R: Read>(
5151
mut err: impl Write,
5252
entry_formatter: &CompiledFormatSpec<CompiledEntryDirective>,
5353
matcher: Option<&CompiledMatcher>,
5454
mut output_stream: impl Write,
55-
source: &mut impl IterateEntries,
55+
source: &mut impl IterateEntries<R>,
5656
) -> Result<(), CommandError> {
5757
if entry_formatter.is_empty() {
5858
writeln!(

src/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1226,7 +1226,7 @@ impl FixedSizeBlock for Zip64DataDescriptorBlock {
12261226
///
12271227
/// According to the [specification](https://www.winzip.com/win/en/aes_info.html#winzip11) AE-2
12281228
/// does not make use of the CRC check.
1229-
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
1229+
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
12301230
#[repr(u16)]
12311231
pub enum AesVendorVersion {
12321232
Ae1 = 0x0001,

src/write.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ pub(crate) enum EncryptWith<'k> {
246246
impl hash::Hash for EncryptWith<'_> {
247247
fn hash<H: hash::Hasher>(&self, state: &mut H) {
248248
match self {
249+
#[cfg(feature = "aes-crypto")]
249250
Self::Aes {mode, password} => {
250251
mode.hash(state);
251252
password.hash(state);

0 commit comments

Comments
 (0)