Skip to content

Commit

Permalink
use lz4_flex 0.9.0 (#1160)
Browse files Browse the repository at this point in the history
  • Loading branch information
PSeitz authored Sep 27, 2021
1 parent fe8e58e commit 0ce49c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ once_cell = "1.7.2"
regex ={ version = "1.5.4", default-features = false, features = ["std"] }
tantivy-fst = "0.3"
memmap2 = {version = "0.5", optional=true}
lz4_flex = { version = "0.8.0", default-features = false, features = ["checked-decode"], optional = true }
lz4_flex = { version = "0.9.0", default-features = false, features = ["checked-decode"], optional = true }
brotli = { version = "3.3", optional = true }
snap = { version = "1.0.5", optional = true }
tempfile = { version = "3.2", optional = true }
Expand Down
4 changes: 2 additions & 2 deletions src/store/compression_lz4_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub fn compress(uncompressed: &[u8], compressed: &mut Vec<u8>) -> io::Result<()>
unsafe {
compressed.set_len(maximum_ouput_size + 4);
}
let bytes_written = compress_into(uncompressed, compressed, 4)
let bytes_written = compress_into(uncompressed, &mut compressed[4..])
.map_err(|err| io::Error::new(io::ErrorKind::InvalidData, err.to_string()))?;
let num_bytes = uncompressed.len() as u32;
compressed[0..4].copy_from_slice(&num_bytes.to_le_bytes());
Expand All @@ -35,7 +35,7 @@ pub fn decompress(compressed: &[u8], decompressed: &mut Vec<u8>) -> io::Result<(
unsafe {
decompressed.set_len(uncompressed_size);
}
let bytes_written = decompress_into(&compressed[4..], decompressed, 0)
let bytes_written = decompress_into(&compressed[4..], decompressed)
.map_err(|err| io::Error::new(io::ErrorKind::InvalidData, err.to_string()))?;
if bytes_written != uncompressed_size {
return Err(io::Error::new(
Expand Down

0 comments on commit 0ce49c9

Please sign in to comment.