From cfd8ecb45fa241ffbbe47956a997912091db5d2c Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Wed, 4 Oct 2023 14:21:44 +0200 Subject: [PATCH] Fix some more clippy warnings --- src/decoder.rs | 8 ++++---- src/worker/rayon.rs | 2 +- tests/rayon-2.rs | 1 - 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/decoder.rs b/src/decoder.rs index e4fa5f64..03205bf0 100644 --- a/src/decoder.rs +++ b/src/decoder.rs @@ -418,7 +418,7 @@ impl Decoder { for (i, plane) in data .into_iter() .enumerate() - .filter(|&(_, ref plane)| !plane.is_empty()) + .filter(|(_, plane)| !plane.is_empty()) { planes_u16[i] = plane; } @@ -467,7 +467,7 @@ impl Decoder { for (i, plane) in data .into_iter() .enumerate() - .filter(|&(_, ref plane)| !plane.is_empty()) + .filter(|(_, plane)| !plane.is_empty()) { if self.coefficients_finished[i] == !0 { planes[i] = plane; @@ -506,14 +506,14 @@ impl Decoder { let current_dc_tables = mem::take(&mut self.dc_huffman_tables); self.dc_huffman_tables = dc_tables .into_iter() - .zip(current_dc_tables.into_iter()) + .zip(current_dc_tables) .map(|(a, b)| a.or(b)) .collect(); let current_ac_tables = mem::take(&mut self.ac_huffman_tables); self.ac_huffman_tables = ac_tables .into_iter() - .zip(current_ac_tables.into_iter()) + .zip(current_ac_tables) .map(|(a, b)| a.or(b)) .collect(); } diff --git a/src/worker/rayon.rs b/src/worker/rayon.rs index ec7df258..7d45084f 100644 --- a/src/worker/rayon.rs +++ b/src/worker/rayon.rs @@ -97,7 +97,7 @@ impl ImmediateWorker { dequantize_and_idct_block( dct_scale, coefficients, - &*quantization_table, + &quantization_table, 8, &mut output_buffer, ); diff --git a/tests/rayon-2.rs b/tests/rayon-2.rs index 982f837e..0fe2b3da 100644 --- a/tests/rayon-2.rs +++ b/tests/rayon-2.rs @@ -13,7 +13,6 @@ fn decoding_in_global_pool() { let _: Vec<_> = (0..1024) .map(|_| { - let path = path.clone(); std::thread::spawn(move || { let mut decoder = Decoder::new(File::open(&path).unwrap()); let _ = decoder.decode().unwrap();