Skip to content

Commit

Permalink
Rollup merge of #97922 - paolobarbolini:no-vecdeque-extra-reserve, r=…
Browse files Browse the repository at this point in the history
…the8472

Remove redundant calls to reserve in impl Write for VecDeque

Removes the reserve calls made redundant by #95904 (as discussed in rust-lang/rust#95632 (comment))
  • Loading branch information
JohnTitor committed Jun 10, 2022
2 parents 500f925 + 8e68335 commit 0181df4
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions 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 0181df4

Please sign in to comment.