Skip to content

Commit a101e07

Browse files
committed
refactor
* Thanks clippy
1 parent 5a2361b commit a101e07

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

gix-features/src/zlib/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ unsafe impl Send for Decompress {}
77

88
impl Decompress {
99
pub fn total_in(&self) -> u64 {
10-
self.0.total_in
10+
self.0.total_in as _
1111
}
1212

1313
pub fn total_out(&self) -> u64 {
14-
self.0.total_out
14+
self.0.total_out as _
1515
}
1616

1717
pub fn new(_zlib_header: bool) -> Self {
@@ -53,7 +53,7 @@ impl Decompress {
5353
libz_rs_sys::Z_DATA_ERROR => Err(DecompressError("data error")),
5454
libz_rs_sys::Z_MEM_ERROR => Err(DecompressError("insufficient memory")),
5555
libz_rs_sys::Z_NEED_DICT => Err(DecompressError("need dictionary")),
56-
c => panic!("unknown return code: {}", c),
56+
c => panic!("unknown return code: {c}"),
5757
}
5858
}
5959
}

gix-features/src/zlib/stream/deflate/mod.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,19 @@ pub struct Compress(Box<libz_rs_sys::z_stream>);
2929
unsafe impl Sync for Compress {}
3030
unsafe impl Send for Compress {}
3131

32+
impl Default for Compress {
33+
fn default() -> Self {
34+
Self::new()
35+
}
36+
}
37+
3238
impl Compress {
3339
pub fn total_in(&self) -> u64 {
34-
self.0.total_in
40+
self.0.total_in as _
3541
}
3642

3743
pub fn total_out(&self) -> u64 {
38-
self.0.total_out
44+
self.0.total_out as _
3945
}
4046

4147
pub fn new() -> Self {

0 commit comments

Comments
 (0)