Skip to content

Commit 09d72f5

Browse files
Rollup merge of #97922 - paolobarbolini:no-vecdeque-extra-reserve, r=the8472
Remove redundant calls to reserve in impl Write for VecDeque Removes the reserve calls made redundant by #95904 (as discussed in #95632 (comment))
2 parents 45e9688 + c71e73e commit 09d72f5

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

library/std/src/io/impls.rs

-2
Original file line numberDiff line numberDiff line change
@@ -441,14 +441,12 @@ impl<A: Allocator> Read for VecDeque<u8, A> {
441441
impl<A: Allocator> Write for VecDeque<u8, A> {
442442
#[inline]
443443
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
444-
self.reserve(buf.len());
445444
self.extend(buf);
446445
Ok(buf.len())
447446
}
448447

449448
#[inline]
450449
fn write_all(&mut self, buf: &[u8]) -> io::Result<()> {
451-
self.reserve(buf.len());
452450
self.extend(buf);
453451
Ok(())
454452
}

0 commit comments

Comments
 (0)