mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 08:44:35 +00:00
Auto merge of #109990 - gwy15:remove-bufwriter-useless-mut-pointer, r=jyn514
Remove an unnecessary `mut` in `BufWriter::into_parts`. `ptr::read` takes `*const T` so `&mut` is not necessary.
This commit is contained in:
commit
97879ce24b
@ -339,7 +339,7 @@ impl<W: Write> BufWriter<W> {
|
||||
let buf = if !self.panicked { Ok(buf) } else { Err(WriterPanicked { buf }) };
|
||||
|
||||
// SAFETY: forget(self) prevents double dropping inner
|
||||
let inner = unsafe { ptr::read(&mut self.inner) };
|
||||
let inner = unsafe { ptr::read(&self.inner) };
|
||||
mem::forget(self);
|
||||
|
||||
(inner, buf)
|
||||
|
Loading…
Reference in New Issue
Block a user