From a1e451349cab0c7e40b50a0c02fe013b1cf7540e Mon Sep 17 00:00:00 2001 From: Christopher Berner Date: Sun, 15 May 2022 20:25:44 -0700 Subject: [PATCH] Fix clippy warnings --- src/decoder.rs | 2 +- src/util.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/decoder.rs b/src/decoder.rs index d63d82d..15de26d 100644 --- a/src/decoder.rs +++ b/src/decoder.rs @@ -165,7 +165,7 @@ impl SourceBlockDecoder { self.sparse_threshold = value; } - fn unpack_sub_blocks(&self, result: &mut Vec, symbol: &Symbol, symbol_index: usize) { + fn unpack_sub_blocks(&self, result: &mut [u8], symbol: &Symbol, symbol_index: usize) { let (tl, ts, nl, ns) = partition( (self.symbol_size / self.symbol_alignment as u16) as u32, self.num_sub_blocks, diff --git a/src/util.rs b/src/util.rs index ce79bd8..abec0b1 100644 --- a/src/util.rs +++ b/src/util.rs @@ -1,6 +1,6 @@ // Get two non-overlapping ranges starting at i & j, both with length len pub fn get_both_ranges( - vector: &mut Vec, + vector: &mut [T], i: usize, j: usize, len: usize, @@ -19,7 +19,7 @@ pub fn get_both_ranges( } } -pub fn get_both_indices(vector: &mut Vec, i: usize, j: usize) -> (&mut T, &mut T) { +pub fn get_both_indices(vector: &mut [T], i: usize, j: usize) -> (&mut T, &mut T) { debug_assert_ne!(i, j); debug_assert!(i < vector.len()); debug_assert!(j < vector.len());