Skip to content

Commit

Permalink
Deprecate Info::encode
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Dec 18, 2024
1 parent 2d6ca8d commit 060925e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<W: Write>(&self, mut w: W) -> encoder::Result<()> {
// Encode the IHDR chunk
let mut data = [0; 13];
Expand Down
1 change: 1 addition & 0 deletions src/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,7 @@ impl<W: Write> Writer<W> {
}

self.w.write_all(&[137, 80, 78, 71, 13, 10, 26, 10])?; // PNG signature
#[allow(deprecated)]
info.encode(&mut self.w)?;

Ok(self)
Expand Down

0 comments on commit 060925e

Please sign in to comment.