diff --git a/src/buf/writer.rs b/src/buf/writer.rs index 08f15d20e..e72348f40 100644 --- a/src/buf/writer.rs +++ b/src/buf/writer.rs @@ -78,7 +78,7 @@ impl io::Write for Writer { fn write(&mut self, src: &[u8]) -> io::Result { let n = cmp::min(self.buf.remaining_mut(), src.len()); - self.buf.put(&src[0..n]); + self.buf.put_slice(&src[..n]); Ok(n) }