Skip to content

Commit fbb120f

Browse files
committed
Use zstd for final compression
1 parent 441b2c2 commit fbb120f

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ tracing = "0.1.41"
3030
tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }
3131
url = { version = "2.5.4", features = ["serde"] }
3232
xz2 = "0.1.7"
33+
zstd = "0.13.2"

src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use std::{
55
};
66

77
use anyhow::{anyhow, bail, Result};
8-
use flate2::{write::GzEncoder, Compression};
98
use sha2::{Digest, Sha256 as Sha256Hasher};
109
use tracing::info;
1110

@@ -33,7 +32,7 @@ pub fn create_tarball<P: AsRef<Path>>(package_path: P, package: &Package) -> Res
3332
let tarball_name = format!("{}-{}.peach", package.info.name, package.info.version);
3433
let tarball_path = current_dir()?.join(&tarball_name);
3534
let tar_gz = File::create(&tarball_path)?;
36-
let enc = GzEncoder::new(tar_gz, Compression::default());
35+
let enc = zstd::Encoder::new(tar_gz, 22)?;
3736
let mut tar = tar::Builder::new(enc);
3837

3938
tar.append_dir_all(".", package_path)?;

0 commit comments

Comments
 (0)