diff --git a/rust/Cargo.Bazel.lock b/rust/Cargo.Bazel.lock index 316480444c72b..c324a0c947fd3 100644 --- a/rust/Cargo.Bazel.lock +++ b/rust/Cargo.Bazel.lock @@ -1,5 +1,5 @@ { - "checksum": "b50f15009b9d7188b2c56599e319668c3625e3e8f8fdd64797cf1e22f3a73b44", + "checksum": "caaba3929b24d3586b1f404473cca35425c3804bee5f3ec0431f8ddef02c1a7e", "crates": { "addr2line 0.19.0": { "name": "addr2line", @@ -1129,55 +1129,6 @@ }, "license": "MIT/Apache-2.0" }, - "bzip2-rs 0.1.2": { - "name": "bzip2-rs", - "version": "0.1.2", - "repository": { - "Http": { - "url": "https://crates.io/api/v1/crates/bzip2-rs/0.1.2/download", - "sha256": "beeb59e7e4c811ab37cc73680c798c7a5da77fc9989c62b09138e31ee740f735" - } - }, - "targets": [ - { - "Library": { - "crate_name": "bzip2_rs", - "crate_root": "src/lib.rs", - "srcs": [ - "**/*.rs" - ] - } - } - ], - "library_target_name": "bzip2_rs", - "common_attrs": { - "compile_data_glob": [ - "**" - ], - "crate_features": { - "common": [ - "default" - ], - "selects": {} - }, - "deps": { - "common": [ - { - "id": "crc32fast 1.3.2", - "target": "crc32fast" - }, - { - "id": "tinyvec 1.6.0", - "target": "tinyvec" - } - ], - "selects": {} - }, - "edition": "2018", - "version": "0.1.2" - }, - "license": "MIT/Apache-2.0" - }, "bzip2-sys 0.1.11+1.0.8": { "name": "bzip2-sys", "version": "0.1.11+1.0.8", @@ -7688,8 +7639,8 @@ "deps": { "common": [ { - "id": "bzip2-rs 0.1.2", - "target": "bzip2_rs" + "id": "bzip2 0.4.4", + "target": "bzip2" }, { "id": "clap 4.3.19", diff --git a/rust/Cargo.lock b/rust/Cargo.lock index fb728b8cc860b..f2c53fa72d911 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -225,16 +225,6 @@ dependencies = [ "libc", ] -[[package]] -name = "bzip2-rs" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "beeb59e7e4c811ab37cc73680c798c7a5da77fc9989c62b09138e31ee740f735" -dependencies = [ - "crc32fast", - "tinyvec", -] - [[package]] name = "bzip2-sys" version = "0.1.11+1.0.8" @@ -1436,7 +1426,7 @@ name = "selenium-manager" version = "0.4.12" dependencies = [ "assert_cmd", - "bzip2-rs", + "bzip2", "clap", "directories", "env_logger", diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 2963e516cb782..6cb58d2989e2c 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -29,7 +29,7 @@ infer = "0.14.0" exitcode = "1.1.2" is_executable = "1.0.1" toml = "0.7.6" -bzip2-rs = "0.1.2" +bzip2 = "0.4.4" sevenz-rust = "0.5.0" [dev-dependencies] diff --git a/rust/src/files.rs b/rust/src/files.rs index a72cc84997352..1c9c4cf74129c 100644 --- a/rust/src/files.rs +++ b/rust/src/files.rs @@ -21,7 +21,7 @@ use std::fs::File; use std::io; use std::io::{BufReader, Cursor, Read}; -use bzip2_rs::DecoderReader; +use bzip2::read::BzDecoder; use std::path::{Path, PathBuf}; use crate::config::OS; @@ -288,9 +288,10 @@ pub fn uncompress_bz2( compressed_file, target.display() )); - let file = File::open(compressed_file)?; - let tar = DecoderReader::new(file); - let mut archive = Archive::new(tar); + let mut bz_decoder = BzDecoder::new(File::open(compressed_file)?); + let mut buffer: Vec = Vec::new(); + bz_decoder.read_to_end(&mut buffer)?; + let mut archive = Archive::new(Cursor::new(buffer)); if !target.exists() { for entry in archive.entries()? { let mut entry_decoder = entry?;