mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 14:31:55 +00:00
Remove an unnecessary mut
in BufWriter::into_parts
.
`ptr::read` takes `*const T` so `&mut` is not necessary.
This commit is contained in:
parent
8c7ad16e82
commit
9169107c1c
@ -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