Skip to content

Commit

Permalink
make clippy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
KillingSpark committed Nov 28, 2024
1 parent 5deca49 commit 3d154de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/bin/zstd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@ fn main() {
}
);
let mut dec = FrameDecoder::new();
let mut decomp = Vec::new();
decomp.reserve(input_len + 10000);
let mut decomp = Vec::with_capacity(input_len);
dec.decode_all_to_vec(&output, &mut decomp).unwrap();

let mut original = Vec::new();
Expand Down
5 changes: 2 additions & 3 deletions src/encoding/match_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ impl Matcher for MatchGeneratorDriver {
self.current_space = space;
self.current_space.as_mut().unwrap()
} else {
let mut space = Vec::new();
space.resize(self.slice_size, 0);
let mut space = alloc::vec![0; self.slice_size];
space.resize(space.capacity(), 0);
self.current_space = Some(space);
self.current_space.as_mut().unwrap()
Expand Down Expand Up @@ -174,7 +173,7 @@ impl MatchGenerator {
self.last_idx_in_sequence = last_entry.leaked_vec.data.len();
self.suffix_idx = last_entry.leaked_vec.data.len();
return Some(Sequence::Literals {
literals: &&last_entry.leaked_vec.data[last_idx_in_sequence..],
literals: &last_entry.leaked_vec.data[last_idx_in_sequence..],
});
}

Expand Down

0 comments on commit 3d154de

Please sign in to comment.