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 https://github.com/rust-lang/rust/pull/95632#discussion_r846850293)
This commit is contained in:
Yuki Okushi
2022-06-10 17:22:31 +09:00
committed by GitHub
-2
View File
@@ -441,14 +441,12 @@ fn read_buf(&mut self, buf: &mut ReadBuf<'_>) -> io::Result<()> {
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(())
}