about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPaolo Barbolini <paolo@paolo565.org>2022-06-09 19:10:09 +0200
committerPaolo Barbolini <paolo@paolo565.org>2022-06-09 19:10:09 +0200
commitc71e73eb61b3f48b3ea22ba66d24d03b1e418074 (patch)
tree85d1de34fc503a0639e6975442539548b0043698
parenta0411e2bfe1fb939757aa96603f0a10d1d9eb029 (diff)
downloadrust-c71e73eb61b3f48b3ea22ba66d24d03b1e418074.tar.gz
rust-c71e73eb61b3f48b3ea22ba66d24d03b1e418074.zip
Remove redundant calls to reserve in impl Write for VecDeque
-rw-r--r--library/std/src/io/impls.rs2
1 files changed, 0 insertions, 2 deletions
diff --git a/library/std/src/io/impls.rs b/library/std/src/io/impls.rs
index 0ca58efe1fe..95072547302 100644
--- a/library/std/src/io/impls.rs
+++ b/library/std/src/io/impls.rs
@@ -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(())
     }