Skip to content

Commit

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

Remove redundant calls to reserve in impl Write for VecDeque

Removes the reserve calls made redundant by rust-lang#95904 (as discussed in rust-lang#95632 (comment))
  • Loading branch information
Dylan-DPC authored Jun 10, 2022
2 parents 8ab0b7e + c71e73e commit eca7229
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 eca7229

Please sign in to comment.