From d2fa00de3589d8b4f3cfc5a0e2cb1c3b80cb60ce Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Mon, 2 Dec 2024 15:30:58 +0100 Subject: [PATCH] Fix clippy lints introduced by the latest rustc release --- libz-rs-sys/src/lib.rs | 2 -- zlib-rs/src/adler32/generic.rs | 2 +- zlib-rs/src/allocate.rs | 2 +- zlib-rs/src/deflate.rs | 4 ++-- zlib-rs/src/inflate.rs | 2 +- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/libz-rs-sys/src/lib.rs b/libz-rs-sys/src/lib.rs index 8e7517f2..16db11ab 100644 --- a/libz-rs-sys/src/lib.rs +++ b/libz-rs-sys/src/lib.rs @@ -1351,7 +1351,6 @@ pub unsafe extern "C-unwind" fn deflateCopy(dest: z_streamp, source: z_streamp) /// - level `1` gives best speed /// - level `9` gives best compression /// - [`Z_DEFAULT_COMPRESSION`] requests a default compromise between speed and compression (currently equivalent to level `6`). - /// /// A call to [`inflateInit_`] is equivalent to [`inflateInit2_`] where /// @@ -1441,7 +1440,6 @@ pub unsafe extern "C-unwind" fn deflateInit_( /// - level `1` gives best speed /// - level `9` gives best compression /// - [`Z_DEFAULT_COMPRESSION`] requests a default compromise between speed and compression (currently equivalent to level `6`). - /// /// A call to [`inflateInit_`] is equivalent to [`inflateInit2_`] where /// diff --git a/zlib-rs/src/adler32/generic.rs b/zlib-rs/src/adler32/generic.rs index 6b4d7fe4..5e3f552f 100644 --- a/zlib-rs/src/adler32/generic.rs +++ b/zlib-rs/src/adler32/generic.rs @@ -77,7 +77,7 @@ pub fn adler32_rust(mut adler: u32, buf: &[u8]) -> u32 { } /* do remaining bytes (less than NMAX, still just one modulo) */ - return adler32_len_64(adler, it.remainder(), sum2); + adler32_len_64(adler, it.remainder(), sum2) } pub(crate) fn adler32_len_1(mut adler: u32, buf: &[u8], mut sum2: u32) -> u32 { diff --git a/zlib-rs/src/allocate.rs b/zlib-rs/src/allocate.rs index 4911c004..6918b160 100644 --- a/zlib-rs/src/allocate.rs +++ b/zlib-rs/src/allocate.rs @@ -160,7 +160,7 @@ impl Allocator<'static> { }; } -impl<'a> Allocator<'a> { +impl Allocator<'_> { pub fn allocate_layout(&self, layout: Layout) -> *mut c_void { // Special case for the Rust `alloc` backed allocator #[cfg(feature = "rust-allocator")] diff --git a/zlib-rs/src/deflate.rs b/zlib-rs/src/deflate.rs index 10641a87..a6d83b92 100644 --- a/zlib-rs/src/deflate.rs +++ b/zlib-rs/src/deflate.rs @@ -2858,8 +2858,8 @@ const fn compress_bound_help(source_len: usize, wrap_len: usize) -> usize { .wrapping_add(wrap_len) } -/// heap used to build the Huffman trees - +/// heap used to build the Huffman trees +/// /// The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. /// The same heap array is used to build all trees. #[derive(Clone)] diff --git a/zlib-rs/src/inflate.rs b/zlib-rs/src/inflate.rs index d4c3ae20..fcd30dd5 100644 --- a/zlib-rs/src/inflate.rs +++ b/zlib-rs/src/inflate.rs @@ -516,7 +516,7 @@ const fn zswap32(q: u32) -> u32 { const INFLATE_FAST_MIN_HAVE: usize = 15; const INFLATE_FAST_MIN_LEFT: usize = 260; -impl<'a> State<'a> { +impl State<'_> { fn dispatch(&mut self) -> ReturnCode { 'label: loop { match self.mode {