Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
KillingSpark committed Nov 18, 2024
1 parent a5666c9 commit 9fe1468
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
3 changes: 1 addition & 2 deletions src/bin/zstd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {} ({}%)",
Expand Down
2 changes: 1 addition & 1 deletion src/encoding/blocks/compressed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 3 additions & 5 deletions src/encoding/frame_encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -167,10 +168,7 @@ impl<R: Read, W: Write> FrameCompressor<R, W> {
};
// 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,
Expand Down
2 changes: 1 addition & 1 deletion src/encoding/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit 9fe1468

Please sign in to comment.