Skip to content

Commit

Permalink
code review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
arichnad committed Sep 18, 2024
1 parent 9035072 commit 077e8a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ impl<W: Write> Writer<W> {
let adaptive_method = self.options.adaptive_filter;

let zlib_encoded = match self.info.compression {
Compression::None => self.stored_only_compressor(data, in_len)?,
Compression::None => Self::stored_only_compressor(data, in_len)?,
Compression::Fast => {
let mut compressor = fdeflate::Compressor::new(std::io::Cursor::new(Vec::new()))?;

Expand Down Expand Up @@ -725,7 +725,7 @@ impl<W: Write> Writer<W> {
// requested by the user. Doing filtering again would only add performance
// cost for both encoding and subsequent decoding, without improving the
// compression ratio.
self.stored_only_compressor(data, in_len)?
Self::stored_only_compressor(data, in_len)?
} else {
compressed
}
Expand Down Expand Up @@ -812,7 +812,7 @@ impl<W: Write> Writer<W> {
Ok(())
}

fn stored_only_compressor(&self, data: &[u8], in_len: usize) -> Result<Vec<u8>> {
fn stored_only_compressor(data: &[u8], in_len: usize) -> Result<Vec<u8>> {
let mut compressor = fdeflate::StoredOnlyCompressor::new(std::io::Cursor::new(Vec::new()))?;
for line in data.chunks(in_len) {
compressor.write_data(&[0])?;
Expand Down

0 comments on commit 077e8a5

Please sign in to comment.