From ab45766424ec66f0575b61d603803f33b2b1e774 Mon Sep 17 00:00:00 2001 From: Kornel Date: Wed, 18 Dec 2024 13:42:38 +0000 Subject: [PATCH 1/4] Allow cfg(fuzzing) --- Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index d49e9258..c0ea2298 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,6 +42,9 @@ term = "0.7" unstable = ["crc32fast/nightly"] benchmarks = [] +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(fuzzing)'] } + [[bench]] path = "benches/decoder.rs" name = "decoder" From 4baeb7063f1b92f5f6cbcdb97dbd18fc3695a07c Mon Sep 17 00:00:00 2001 From: Kornel Date: Wed, 18 Dec 2024 13:42:45 +0000 Subject: [PATCH 2/4] Bump dev dep --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index c0ea2298..38000983 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,7 @@ getopts = "0.2.14" glium = { version = "0.32", features = ["glutin"], default-features = false } glob = "0.3" rand = "0.8.4" -term = "0.7" +term = "1.0.1" [features] unstable = ["crc32fast/nightly"] From 2d6ca8d4e9bdb4f849bdfdb529ec7db8a7e1facc Mon Sep 17 00:00:00 2001 From: Kornel Date: Wed, 18 Dec 2024 13:42:49 +0000 Subject: [PATCH 3/4] Bump version --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 38000983..5aeba7f2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "png" -version = "0.17.15" +version = "0.17.16" license = "MIT OR Apache-2.0" description = "PNG decoding and encoding library in pure Rust" From 060925e5a436de33528af81f62031faa9bcde2b9 Mon Sep 17 00:00:00 2001 From: Kornel Date: Wed, 18 Dec 2024 16:17:52 +0000 Subject: [PATCH 4/4] Deprecate Info::encode #418 --- src/common.rs | 1 + src/encoder.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/common.rs b/src/common.rs index 36ad78b6..cb56e6e7 100644 --- a/src/common.rs +++ b/src/common.rs @@ -740,6 +740,7 @@ impl Info<'_> { /// /// Note that this does _not_ include the PNG signature, it starts with the IHDR chunk and then /// includes other chunks that were added to the header. + #[deprecated(note = "Use Encoder+Writer instead")] pub fn encode(&self, mut w: W) -> encoder::Result<()> { // Encode the IHDR chunk let mut data = [0; 13]; diff --git a/src/encoder.rs b/src/encoder.rs index 9f275e5e..c143fa04 100644 --- a/src/encoder.rs +++ b/src/encoder.rs @@ -590,6 +590,7 @@ impl Writer { } self.w.write_all(&[137, 80, 78, 71, 13, 10, 26, 10])?; // PNG signature + #[allow(deprecated)] info.encode(&mut self.w)?; Ok(self)