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.
This commit is contained in:
Chris Denton 2023-11-21 23:06:35 +00:00
parent 6c22e57c39
commit bfbeb3ebd9
No known key found for this signature in database
GPG Key ID: 713472F2F45627DE
2 changed files with 4 additions and 4 deletions

View File

@ -127,7 +127,7 @@ pub fn try_clone_to_owned(&self) -> io::Result<OwnedSocket> {
info.iAddressFamily,
info.iSocketType,
info.iProtocol,
&mut info,
&info,
0,
sys::c::WSA_FLAG_OVERLAPPED | sys::c::WSA_FLAG_NO_HANDLE_INHERIT,
)
@ -147,7 +147,7 @@ pub fn try_clone_to_owned(&self) -> io::Result<OwnedSocket> {
info.iAddressFamily,
info.iSocketType,
info.iProtocol,
&mut info,
&info,
0,
sys::c::WSA_FLAG_OVERLAPPED,
)

View File

@ -786,7 +786,7 @@ fn open_link_no_reparse(parent: &File, name: &[u16], access: u32) -> io::Result<
// tricked into following a symlink. However, it may not be available in
// earlier versions of Windows.
static ATTRIBUTES: AtomicU32 = AtomicU32::new(c::OBJ_DONT_REPARSE);
let mut object = c::OBJECT_ATTRIBUTES {
let object = c::OBJECT_ATTRIBUTES {
ObjectName: &mut name_str,
RootDirectory: parent.as_raw_handle(),
Attributes: ATTRIBUTES.load(Ordering::Relaxed),
@ -795,7 +795,7 @@ fn open_link_no_reparse(parent: &File, name: &[u16], access: u32) -> io::Result<
let status = c::NtCreateFile(
&mut handle,
access,
&mut object,
&object,
&mut io_status,
crate::ptr::null_mut(),
0,