about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2022-06-10 17:22:31 +0900
committerGitHub <noreply@github.com>2022-06-10 17:22:31 +0900
commit3e5ddb73a8863c5f80243f8a709802cebb4af76f (patch)
tree27c75789793cabb48c5df01cd72f1eee9a2a4d37
parent20be5da7122e5fbd9b4acd815a6f69f09363aa8d (diff)
parentc71e73eb61b3f48b3ea22ba66d24d03b1e418074 (diff)
downloadrust-3e5ddb73a8863c5f80243f8a709802cebb4af76f.tar.gz
rust-3e5ddb73a8863c5f80243f8a709802cebb4af76f.zip
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)
-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(())
     }