Skip to content

Commit c3ec0f8

Browse files
committed
feat: use default on new
1 parent 872ab26 commit c3ec0f8

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

src/crc.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,8 @@ pub struct CrcReader<R> {
2525

2626
impl Crc {
2727
/// Create a new CRC.
28-
pub fn new() -> Crc {
29-
Crc {
30-
amt: 0,
31-
hasher: Hasher::new(),
32-
}
28+
pub fn new() -> Self {
29+
Self::default()
3330
}
3431

3532
/// Returns the current crc32 checksum.

src/gz/mod.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -324,13 +324,7 @@ pub struct GzBuilder {
324324
impl GzBuilder {
325325
/// Create a new blank builder with no header by default.
326326
pub fn new() -> GzBuilder {
327-
GzBuilder {
328-
extra: None,
329-
filename: None,
330-
comment: None,
331-
operating_system: None,
332-
mtime: 0,
333-
}
327+
Self::default()
334328
}
335329

336330
/// Configure the `mtime` field in the gzip header.

0 commit comments

Comments
 (0)