Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
cberner committed May 16, 2022
1 parent 9a47489 commit a1e4513
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ impl SourceBlockDecoder {
self.sparse_threshold = value;
}

fn unpack_sub_blocks(&self, result: &mut Vec<u8>, 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,
Expand Down
4 changes: 2 additions & 2 deletions src/util.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Get two non-overlapping ranges starting at i & j, both with length len
pub fn get_both_ranges<T>(
vector: &mut Vec<T>,
vector: &mut [T],
i: usize,
j: usize,
len: usize,
Expand All @@ -19,7 +19,7 @@ pub fn get_both_ranges<T>(
}
}

pub fn get_both_indices<T>(vector: &mut Vec<T>, i: usize, j: usize) -> (&mut T, &mut T) {
pub fn get_both_indices<T>(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());
Expand Down

0 comments on commit a1e4513

Please sign in to comment.