Skip to content

Commit

Permalink
Remove redundant calls to reserve in impl Write for VecDeque
Browse files Browse the repository at this point in the history
  • Loading branch information
paolobarbolini committed Jun 9, 2022
1 parent a0411e2 commit c71e73e
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions library/std/src/io/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}
Expand Down

0 comments on commit c71e73e

Please sign in to comment.