mirror of https://github.com/tauri-apps/tauri
deps: Libflate to flate2 (#8618)
* Replace libflate with flate2 * Add .changes file * Cargo fmt
This commit is contained in:
parent
06890c70c6
commit
4926648751
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"tauri-bundler": patch:deps
|
||||
---
|
||||
|
||||
Replace `libflate` with `flate2` , this will help to provide additional functionalities and features.
|
|
@ -19,7 +19,7 @@ exclude = [ "CHANGELOG.md", "/target", "rustfmt.toml" ]
|
|||
[dependencies]
|
||||
tauri-utils = { version = "1.5.2", path = "../../core/tauri-utils", features = [ "resources" ] }
|
||||
image = "0.24.7"
|
||||
libflate = "2.0"
|
||||
flate2 = "1.0"
|
||||
anyhow = "1.0"
|
||||
thiserror = "1.0"
|
||||
serde_json = "1.0"
|
||||
|
|
|
@ -29,7 +29,6 @@ use anyhow::Context;
|
|||
use handlebars::Handlebars;
|
||||
use heck::AsKebabCase;
|
||||
use image::{self, codecs::png::PngDecoder, ImageDecoder};
|
||||
use libflate::gzip;
|
||||
use log::info;
|
||||
use serde::Serialize;
|
||||
use tar::HeaderMode;
|
||||
|
@ -44,6 +43,8 @@ use std::{
|
|||
path::{Path, PathBuf},
|
||||
};
|
||||
|
||||
use flate2::{write::GzEncoder, Compression};
|
||||
|
||||
#[derive(PartialEq, Eq, PartialOrd, Ord)]
|
||||
pub struct DebIcon {
|
||||
pub width: u32,
|
||||
|
@ -391,9 +392,9 @@ fn tar_and_gzip_dir<P: AsRef<Path>>(src_dir: P) -> crate::Result<PathBuf> {
|
|||
let src_dir = src_dir.as_ref();
|
||||
let dest_path = src_dir.with_extension("tar.gz");
|
||||
let dest_file = common::create_file(&dest_path)?;
|
||||
let gzip_encoder = gzip::Encoder::new(dest_file)?;
|
||||
let gzip_encoder = GzEncoder::new(dest_file, Compression::default());
|
||||
let gzip_encoder = create_tar_from_dir(src_dir, gzip_encoder)?;
|
||||
let mut dest_file = gzip_encoder.finish().into_result()?;
|
||||
let mut dest_file = gzip_encoder.finish()?;
|
||||
dest_file.flush()?;
|
||||
Ok(dest_path)
|
||||
}
|
||||
|
|
|
@ -23,6 +23,8 @@ use std::{
|
|||
path::{Path, PathBuf},
|
||||
};
|
||||
|
||||
use flate2::{write::GzEncoder, Compression};
|
||||
|
||||
use anyhow::Context;
|
||||
use log::info;
|
||||
use zip::write::FileOptions;
|
||||
|
@ -235,11 +237,11 @@ pub fn create_zip(src_file: &Path, dst_file: &Path) -> crate::Result<PathBuf> {
|
|||
#[cfg(not(target_os = "windows"))]
|
||||
fn create_tar(src_dir: &Path, dest_path: &Path) -> crate::Result<PathBuf> {
|
||||
let dest_file = common::create_file(dest_path)?;
|
||||
let gzip_encoder = libflate::gzip::Encoder::new(dest_file)?;
|
||||
let gzip_encoder = GzEncoder::new(dest_file, Compression::default());
|
||||
|
||||
let gzip_encoder = create_tar_from_src(src_dir, gzip_encoder)?;
|
||||
|
||||
let mut dest_file = gzip_encoder.finish().into_result()?;
|
||||
let mut dest_file = gzip_encoder.finish()?;
|
||||
dest_file.flush()?;
|
||||
Ok(dest_path.to_owned())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue