From 9fe14688d83c9507761d62fafcd938ae574c0a9d Mon Sep 17 00:00:00 2001 From: Moritz Borcherding Date: Mon, 18 Nov 2024 10:17:46 +0100 Subject: [PATCH] cargo fmt --- src/bin/zstd.rs | 3 +-- src/encoding/blocks/compressed.rs | 2 +- src/encoding/frame_encoder.rs | 8 +++----- src/encoding/mod.rs | 2 +- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/bin/zstd.rs b/src/bin/zstd.rs index f4eb2ef..538886b 100644 --- a/src/bin/zstd.rs +++ b/src/bin/zstd.rs @@ -138,8 +138,7 @@ fn main() { let input_len = file.metadata().unwrap().len() as usize; let file = BufReader::new(file); let mut output = Vec::new(); - let mut encoder = - FrameCompressor::new(file, &mut output, CompressionLevel::Fastest); + let mut encoder = FrameCompressor::new(file, &mut output, CompressionLevel::Fastest); encoder.compress(); println!( "Compressed {path:} from {} to {} ({}%)", diff --git a/src/encoding/blocks/compressed.rs b/src/encoding/blocks/compressed.rs index b9fc26e..3259611 100644 --- a/src/encoding/blocks/compressed.rs +++ b/src/encoding/blocks/compressed.rs @@ -36,7 +36,7 @@ pub fn compress_block<'a>(matcher: &mut MatchGenerator<'a>, data: &'a [u8], outp } // literals section - + let mut writer = BitWriter::from(output); if literals_vec.len() > 1024 { compress_literals(&literals_vec, &mut writer); diff --git a/src/encoding/frame_encoder.rs b/src/encoding/frame_encoder.rs index e6a4bca..248ef7b 100644 --- a/src/encoding/frame_encoder.rs +++ b/src/encoding/frame_encoder.rs @@ -6,7 +6,8 @@ use core::convert::TryInto; use super::{ block_header::BlockHeader, blocks::{compress_block, compress_raw_block}, - frame_header::FrameHeader, match_generator::MatchGenerator, + frame_header::FrameHeader, + match_generator::MatchGenerator, }; use crate::io::{Read, Write}; @@ -167,10 +168,7 @@ impl FrameCompressor { }; // Write the header, then the block header.serialize(output); - compress_raw_block( - uncompressed, - output, - ); + compress_raw_block(uncompressed, output); } else { let header = BlockHeader { last_block, diff --git a/src/encoding/mod.rs b/src/encoding/mod.rs index baefd81..5271496 100644 --- a/src/encoding/mod.rs +++ b/src/encoding/mod.rs @@ -6,5 +6,5 @@ pub(crate) mod blocks; mod frame_encoder; pub use frame_encoder::*; pub(crate) mod frame_header; +pub(crate) mod match_generator; pub(crate) mod util; -pub(crate) mod match_generator; \ No newline at end of file