Skip to content

Commit

Permalink
Slightly more generic
Browse files Browse the repository at this point in the history
Since `Write` is automatically implemented for `&'_ mut impl Write`.
  • Loading branch information
malthe authored and HeroicKatora committed Jun 13, 2020
1 parent d01130c commit 5dec33d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ pub struct Writer<W: Write> {

const DEFAULT_BUFFER_LENGTH: usize = 4 * 1024;

fn write_chunk<W: Write>(w: &mut W, name: [u8; 4], data: &[u8]) -> Result<()> {
fn write_chunk<W: Write>(mut w: W, name: [u8; 4], data: &[u8]) -> Result<()> {
w.write_be(data.len() as u32)?;
w.write_all(&name)?;
w.write_all(data)?;
Expand Down

0 comments on commit 5dec33d

Please sign in to comment.