Skip to content

Commit 68ba8f6

Browse files
committed
Use explicit Default for GzHeaderState enum
This allows the crate to build with Rust older than 1.62.
1 parent b1e993a commit 68ba8f6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/gz/mod.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -87,18 +87,23 @@ impl GzHeader {
8787
}
8888
}
8989

90-
#[derive(Debug, Default)]
90+
#[derive(Debug)]
9191
pub enum GzHeaderState {
9292
Start(u8, [u8; 10]),
9393
Xlen(Option<Box<Crc>>, u8, [u8; 2]),
9494
Extra(Option<Box<Crc>>, u16),
9595
Filename(Option<Box<Crc>>),
9696
Comment(Option<Box<Crc>>),
9797
Crc(Option<Box<Crc>>, u8, [u8; 2]),
98-
#[default]
9998
Complete,
10099
}
101100

101+
impl Default for GzHeaderState {
102+
fn default() -> Self {
103+
Self::Complete
104+
}
105+
}
106+
102107
#[derive(Debug, Default)]
103108
pub struct GzHeaderParser {
104109
state: GzHeaderState,

0 commit comments

Comments
 (0)