From c71e73eb61b3f48b3ea22ba66d24d03b1e418074 Mon Sep 17 00:00:00 2001 From: Paolo Barbolini Date: Thu, 9 Jun 2022 19:10:09 +0200 Subject: [PATCH] Remove redundant calls to reserve in impl Write for VecDeque --- library/std/src/io/impls.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/library/std/src/io/impls.rs b/library/std/src/io/impls.rs index 0ca58efe1fe2f..95072547302eb 100644 --- a/library/std/src/io/impls.rs +++ b/library/std/src/io/impls.rs @@ -441,14 +441,12 @@ impl Read for VecDeque { impl Write for VecDeque { #[inline] fn write(&mut self, buf: &[u8]) -> io::Result { - 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(()) }