1
Fork 0

Remove redundant calls to reserve in impl Write for VecDeque

This commit is contained in:
Paolo Barbolini 2022-06-09 19:10:09 +02:00
parent a0411e2bfe
commit c71e73eb61

View file

@ -441,14 +441,12 @@ impl<A: Allocator> Read for VecDeque<u8, A> {
impl<A: Allocator> Write for VecDeque<u8, A> {
#[inline]
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
self.reserve(buf.len());
self.extend(buf);
Ok(buf.len())
}
#[inline]
fn write_all(&mut self, buf: &[u8]) -> io::Result<()> {
self.reserve(buf.len());
self.extend(buf);
Ok(())
}