Skip to content

Commit

Permalink
Update zstd-safe to 7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralith committed Mar 29, 2024
1 parent 206a88d commit fc1c4af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion save/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ edition = "2021"
prost = "0.12.2"
redb = "1.0"
thiserror = "1.0.38"
zstd = { package = "zstd-safe", version = "6.0.4", features = ["std", "experimental"] }
zstd = { package = "zstd-safe", version = "7.1.0", default-features = false, features = ["std", "experimental"] }

[dev-dependencies]
tempfile = "3.4"
Expand Down
6 changes: 3 additions & 3 deletions save/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,12 @@ fn decompress(
) -> Result<(), &'static str> {
dctx.init().map_err(zstd::get_error_name)?;
let mut input = zstd::InBuffer::around(compressed);
let mut out = zstd::OutBuffer::around(out);
let out_size = zstd::DCtx::out_size();
loop {
if out.dst.len() + out_size > out.dst.capacity() {
out.dst.reserve(out_size);
if out.len() + out_size > out.capacity() {
out.reserve(out_size);
}
let mut out = zstd::OutBuffer::around_pos(out, out.len());
let n = dctx
.decompress_stream(&mut out, &mut input)
.map_err(zstd::get_error_name)?;
Expand Down

0 comments on commit fc1c4af

Please sign in to comment.