From 060925e5a436de33528af81f62031faa9bcde2b9 Mon Sep 17 00:00:00 2001 From: Kornel Date: Wed, 18 Dec 2024 16:17:52 +0000 Subject: [PATCH] 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 36ad78b6c7..cb56e6e735 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 9f275e5edb..c143fa04ac 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)