Skip to content

Commit bfbeb3e

Browse files
committed
unnecessary_mut_passed
This is where our Windows API bindings previously (and incorrectly) used `*mut` instead of `*const` pointers. Now that the bindings have been corrected, the mutable references (which auto-convert to `*mut`) are unnecessary and we can use shared references.
1 parent 6c22e57 commit bfbeb3e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

library/std/src/os/windows/io/socket.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ impl BorrowedSocket<'_> {
127127
info.iAddressFamily,
128128
info.iSocketType,
129129
info.iProtocol,
130-
&mut info,
130+
&info,
131131
0,
132132
sys::c::WSA_FLAG_OVERLAPPED | sys::c::WSA_FLAG_NO_HANDLE_INHERIT,
133133
)
@@ -147,7 +147,7 @@ impl BorrowedSocket<'_> {
147147
info.iAddressFamily,
148148
info.iSocketType,
149149
info.iProtocol,
150-
&mut info,
150+
&info,
151151
0,
152152
sys::c::WSA_FLAG_OVERLAPPED,
153153
)

library/std/src/sys/windows/fs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ fn open_link_no_reparse(parent: &File, name: &[u16], access: u32) -> io::Result<
786786
// tricked into following a symlink. However, it may not be available in
787787
// earlier versions of Windows.
788788
static ATTRIBUTES: AtomicU32 = AtomicU32::new(c::OBJ_DONT_REPARSE);
789-
let mut object = c::OBJECT_ATTRIBUTES {
789+
let object = c::OBJECT_ATTRIBUTES {
790790
ObjectName: &mut name_str,
791791
RootDirectory: parent.as_raw_handle(),
792792
Attributes: ATTRIBUTES.load(Ordering::Relaxed),
@@ -795,7 +795,7 @@ fn open_link_no_reparse(parent: &File, name: &[u16], access: u32) -> io::Result<
795795
let status = c::NtCreateFile(
796796
&mut handle,
797797
access,
798-
&mut object,
798+
&object,
799799
&mut io_status,
800800
crate::ptr::null_mut(),
801801
0,

0 commit comments

Comments
 (0)