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:
commit
3e5ddb73a8
1 changed files with 0 additions and 2 deletions
|
@ -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(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue