Skip to content

Commit

Permalink
Reworded docs for encoder::Writer::write_chunk() (#565)
Browse files Browse the repository at this point in the history
  • Loading branch information
Some1and2-XC authored Jan 1, 2025
1 parent 0a0fba1 commit 7ab5bb6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -662,8 +662,10 @@ impl<W: Write> Writer<W> {

/// Write a raw chunk of PNG data.
///
/// The chunk will have its CRC calculated and correctly. The data is not filtered in any way,
/// but the chunk needs to be short enough to have its length encoded correctly.
/// This function calculates the required CRC sum so this should not be included in the input
/// `data`, otherwise the data is not filtered in any way. This function returns an error if
/// the length of `data` can't be parsed as a `u32` though the length of the chunk data should
/// not exceed `i32::MAX` or 2,147,483,647.
pub fn write_chunk(&mut self, name: ChunkType, data: &[u8]) -> Result<()> {
use std::convert::TryFrom;

Expand Down

0 comments on commit 7ab5bb6

Please sign in to comment.