]> git.nihav.org Git - nihav.git/commitdiff
core/compr: fix clippy warnings
authorKostya Shishkov <kostya.shishkov@gmail.com>
Wed, 24 May 2023 17:20:11 +0000 (19:20 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Thu, 25 May 2023 10:19:53 +0000 (12:19 +0200)
nihav-core/src/compr/deflate.rs

index 3932473959867d2128ec018b1ac40407c28d7d9b..e3f1f13bf002adf8da28b7426ec2529095b62350 100644 (file)
@@ -790,6 +790,7 @@ impl Inflate {
         self.state = InflateState::Start;
     }
 
+    #[allow(clippy::comparison_chain)]
     ///! Decompresses input data into output returning the uncompressed data length.
     pub fn uncompress(src: &[u8], dst: &mut [u8]) -> DecompressResult<usize> {
         let mut csrc = CurrentSource::new(src, BitReaderState::default());
@@ -886,13 +887,11 @@ impl Inflate {
                     }
                     let hdist = csrc.read(5)? as usize + 1;
                     let hclen = csrc.read(4)? as usize + 4;
-                    let mut cur_len_idx = 0;
                     let mut len_lengths = [0; 19];
                     let mut all_lengths = [0; NUM_LITERALS + NUM_DISTS];
 
-                    for _ in 0..hclen {
+                    for cur_len_idx in 0..hclen {
                         len_lengths[LEN_RECODE[cur_len_idx]] = csrc.read(3)? as u8;
-                        cur_len_idx += 1;
                     }
                     let mut len_codes = [ShortCodebookDesc { code: 0, bits: 0 }; 19];
                     lengths_to_codes(&len_lengths, &mut len_codes)?;