From e6404875726549f28eec66e9f42538dba8c8028b Mon Sep 17 00:00:00 2001 From: Noa Date: Thu, 17 Apr 2025 12:10:17 -0500 Subject: [PATCH] Use libbz2-rs-sys for bzip2 implementation Co-authored-by: Ashwin Naren --- Cargo.lock | 12 +++++++++--- stdlib/Cargo.toml | 2 +- stdlib/src/bz2.rs | 4 ++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 87cfb5510..0255535c1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -239,12 +239,12 @@ checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540" [[package]] name = "bzip2" -version = "0.4.4" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" +checksum = "49ecfb22d906f800d4fe833b6282cf4dc1c298f5057ca0b5445e5c209735ca47" dependencies = [ "bzip2-sys", - "libc", + "libbz2-rs-sys", ] [[package]] @@ -1322,6 +1322,12 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9fa0e2a1fcbe2f6be6c42e342259976206b383122fc152e872795338b5a3f3a7" +[[package]] +name = "libbz2-rs-sys" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0864a00c8d019e36216b69c2c4ce50b83b7bd966add3cf5ba554ec44f8bebcf5" + [[package]] name = "libc" version = "0.2.171" diff --git a/stdlib/Cargo.toml b/stdlib/Cargo.toml index eb6b9fe4d..ac1a6c41e 100644 --- a/stdlib/Cargo.toml +++ b/stdlib/Cargo.toml @@ -80,7 +80,7 @@ adler32 = "1.2.0" crc32fast = "1.3.2" flate2 = { version = "1.1", default-features = false, features = ["zlib-rs"] } libz-sys = { package = "libz-rs-sys", version = "0.5" } -bzip2 = { version = "0.4", optional = true } +bzip2 = { version = "0.5", optional = true, features = ["libbz2-rs-sys"] } # tkinter tk-sys = { git = "https://github.com/arihant2math/tkinter.git", tag = "v0.1.0", optional = true } diff --git a/stdlib/src/bz2.rs b/stdlib/src/bz2.rs index ba74a38db..e580cbd71 100644 --- a/stdlib/src/bz2.rs +++ b/stdlib/src/bz2.rs @@ -33,7 +33,7 @@ mod _bz2 { } impl fmt::Debug for BZ2Decompressor { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "_bz2.BZ2Decompressor") } } @@ -178,7 +178,7 @@ mod _bz2 { } impl fmt::Debug for BZ2Compressor { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "_bz2.BZ2Compressor") } }