From b5791867ca5c37659374343c50ad9326381d6dc1 Mon Sep 17 00:00:00 2001 From: Pascal Seitz Date: Sat, 7 Sep 2024 10:23:36 +0800 Subject: [PATCH] fix clippy --- src/block/compress.rs | 2 +- src/sink.rs | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/block/compress.rs b/src/block/compress.rs index 97a2d89..d4308b4 100644 --- a/src/block/compress.rs +++ b/src/block/compress.rs @@ -627,7 +627,7 @@ fn init_dict(dict: &mut T, dict_data: &mut &[u8]) { /// Can be used to preallocate capacity on the output vector #[inline] pub const fn get_maximum_output_size(input_len: usize) -> usize { - 16 + 4 + (input_len * 110 / 100) as usize + 16 + 4 + (input_len * 110 / 100) } /// Compress all bytes of `input` into `output`. diff --git a/src/sink.rs b/src/sink.rs index 45f3b4b..721b6a6 100644 --- a/src/sink.rs +++ b/src/sink.rs @@ -321,9 +321,7 @@ mod tests { fn test_sink_slice() { use crate::sink::Sink; use crate::sink::SliceSink; - use alloc::vec::Vec; - let mut data = Vec::new(); - data.resize(5, 0); + let mut data = vec![0; 5]; let sink = SliceSink::new(&mut data, 1); assert_eq!(sink.pos(), 1); assert_eq!(sink.capacity(), 5);