From ef8c80ffb5e219a7a75e6f3957be842f502da7e7 Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Fri, 29 Nov 2024 14:15:43 +0100 Subject: [PATCH] clippy --- libz-rs-sys/src/lib.rs | 7 +------ zlib-rs/src/adler32/generic.rs | 2 +- zlib-rs/src/allocate.rs | 2 +- zlib-rs/src/deflate.rs | 2 +- zlib-rs/src/inflate.rs | 2 +- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/libz-rs-sys/src/lib.rs b/libz-rs-sys/src/lib.rs index 8e7517f2..61ac4b92 100644 --- a/libz-rs-sys/src/lib.rs +++ b/libz-rs-sys/src/lib.rs @@ -1351,9 +1351,8 @@ 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 +/// A call to [`deflateInit_`] is equivalent to [`deflateInit2_`] where: /// /// - `method` is `8` (deflate) /// - `windowBits` is `15` @@ -1441,10 +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 -/// /// /// # Returns /// 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..e256df4a 100644 --- a/zlib-rs/src/deflate.rs +++ b/zlib-rs/src/deflate.rs @@ -2859,7 +2859,7 @@ const fn compress_bound_help(source_len: usize, wrap_len: usize) -> usize { } /// 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 {