Skip to content

Commit 872ab26

Browse files
committed
feat: remove explicit clone impl on GzHeaderState and GzBuilder
1 parent 84ef29c commit 872ab26

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

src/gz/mod.rs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -87,23 +87,18 @@ impl GzHeader {
8787
}
8888
}
8989

90-
#[derive(Debug)]
90+
#[derive(Debug, Default)]
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]
9899
Complete,
99100
}
100101

101-
impl Default for GzHeaderState {
102-
fn default() -> Self {
103-
Self::Complete
104-
}
105-
}
106-
107102
#[derive(Debug, Default)]
108103
pub struct GzHeaderParser {
109104
state: GzHeaderState,
@@ -317,7 +312,7 @@ fn corrupt() -> Error {
317312
/// # Ok(())
318313
/// # }
319314
/// ```
320-
#[derive(Debug)]
315+
#[derive(Debug, Default)]
321316
pub struct GzBuilder {
322317
extra: Option<Vec<u8>>,
323318
filename: Option<CString>,
@@ -326,12 +321,6 @@ pub struct GzBuilder {
326321
mtime: u32,
327322
}
328323

329-
impl Default for GzBuilder {
330-
fn default() -> Self {
331-
Self::new()
332-
}
333-
}
334-
335324
impl GzBuilder {
336325
/// Create a new blank builder with no header by default.
337326
pub fn new() -> GzBuilder {

0 commit comments

Comments
 (0)