update zstd to 0.12

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2023-01-04 15:17:02 +01:00 committed by Thomas Lamprecht
parent ed6eb52acd
commit 4341a3f0cc
4 changed files with 5 additions and 5 deletions

View File

@ -150,7 +150,7 @@ udev = "0.4"
url = "2.1"
walkdir = "2"
xdg = "2.2"
zstd = { version = "0.6", features = [ "bindgen" ] }
zstd = { version = ">= 0.6, < 0.13", features = [ "bindgen" ] }
[dependencies]
anyhow.workspace = true

4
debian/control vendored
View File

@ -127,8 +127,8 @@ Build-Depends: debhelper-compat (= 13),
librust-url-2+default-dev (>= 2.1-~~),
librust-walkdir-2+default-dev,
librust-xdg-2+default-dev (>= 2.2-~~),
librust-zstd-0.6+bindgen-dev,
librust-zstd-0.6+default-dev,
librust-zstd-0.12+bindgen-dev,
librust-zstd-0.12+default-dev,
libacl1-dev,
libfuse3-dev,
libsystemd-dev (>= 246-~~),

View File

@ -35,7 +35,7 @@ fn main() -> Result<(), Error> {
});
rate_test("zstd", &|| {
zstd::block::compress(&input, 1).unwrap();
zstd::bulk::compress(&input, 1).unwrap();
input.len()
});

View File

@ -96,7 +96,7 @@ impl DataBlob {
let mut blob = if let Some(config) = config {
let compr_data;
let (_compress, data, magic) = if compress {
compr_data = zstd::block::compress(data, 1)?;
compr_data = zstd::bulk::compress(data, 1)?;
// Note: We only use compression if result is shorter
if compr_data.len() < data.len() {
(true, &compr_data[..], ENCR_COMPR_BLOB_MAGIC_1_0)