mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-07 00:00:13 +02:00
Replace BufMut::put with BufMut::put_slice in Writer impl (#745)
This commit is contained in:
+1
-1
@@ -78,7 +78,7 @@ impl<B: BufMut + Sized> io::Write for Writer<B> {
|
||||
fn write(&mut self, src: &[u8]) -> io::Result<usize> {
|
||||
let n = cmp::min(self.buf.remaining_mut(), src.len());
|
||||
|
||||
self.buf.put(&src[0..n]);
|
||||
self.buf.put_slice(&src[..n]);
|
||||
Ok(n)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user