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 #95632 (comment))
  • Loading branch information
JohnTitor authored Jun 10, 2022
2 parents 20be5da + c71e73e commit 3e5ddb7
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 3e5ddb7

Please sign in to comment.