about summary refs log tree commit diff
path: root/library/std
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-04-07 05:49:34 +0000
committerbors <bors@rust-lang.org>2023-04-07 05:49:34 +0000
commit97879ce24ba6fbc89b1a7a9bef5d31f73963646c (patch)
tree59b979d03db5928ab0e435186440750a768b1079 /library/std
parent32ea4bb9e3785ae76660b1303e821255c02aad1a (diff)
parent9169107c1cf15bc955bb15a06d83a1ebf011e9eb (diff)
downloadrust-97879ce24ba6fbc89b1a7a9bef5d31f73963646c.tar.gz
rust-97879ce24ba6fbc89b1a7a9bef5d31f73963646c.zip
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.
Diffstat (limited to 'library/std')
-rw-r--r--library/std/src/io/buffered/bufwriter.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/std/src/io/buffered/bufwriter.rs b/library/std/src/io/buffered/bufwriter.rs
index 6acb937e784..14c455d4fa3 100644
--- a/library/std/src/io/buffered/bufwriter.rs
+++ b/library/std/src/io/buffered/bufwriter.rs
@@ -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)