Skip to content

Commit

Permalink
Use explicit Default for GzHeaderState enum
Browse files Browse the repository at this point in the history
This allows the crate to build with Rust older than 1.62.
  • Loading branch information
jongiddy committed Aug 26, 2023
1 parent b1e993a commit 68ba8f6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/gz/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,23 @@ impl GzHeader {
}
}

#[derive(Debug, Default)]
#[derive(Debug)]
pub enum GzHeaderState {
Start(u8, [u8; 10]),
Xlen(Option<Box<Crc>>, u8, [u8; 2]),
Extra(Option<Box<Crc>>, u16),
Filename(Option<Box<Crc>>),
Comment(Option<Box<Crc>>),
Crc(Option<Box<Crc>>, u8, [u8; 2]),
#[default]
Complete,
}

impl Default for GzHeaderState {
fn default() -> Self {
Self::Complete
}
}

#[derive(Debug, Default)]
pub struct GzHeaderParser {
state: GzHeaderState,
Expand Down

0 comments on commit 68ba8f6

Please sign in to comment.