diff --git a/common/src/fileutils.rs b/common/src/fileutils.rs index ce4aa8250a..cabeb833c1 100644 --- a/common/src/fileutils.rs +++ b/common/src/fileutils.rs @@ -153,7 +153,7 @@ pub mod windows { let p_id_info = if unsafe { GetFileInformationByHandleEx( - h as _, + h as _, FileIdInfo, &mut id_info as *mut _ as *mut _, std::mem::size_of_val(&id_info) as u32, diff --git a/stdlib/src/overlapped.rs b/stdlib/src/overlapped.rs index d3c46cad0a..8877e5befb 100644 --- a/stdlib/src/overlapped.rs +++ b/stdlib/src/overlapped.rs @@ -303,7 +303,12 @@ mod _overlapped { vm: &VirtualMachine, ) -> PyResult { let r = unsafe { - windows_sys::Win32::System::IO::CreateIoCompletionPort(handle as _, port as _, key, concurrency) as isize + windows_sys::Win32::System::IO::CreateIoCompletionPort( + handle as _, + port as _, + key, + concurrency, + ) as isize }; if r as usize == 0 { return Err(errno_err(vm)); diff --git a/stdlib/src/socket.rs b/stdlib/src/socket.rs index 39c21da544..39bfde4bee 100644 --- a/stdlib/src/socket.rs +++ b/stdlib/src/socket.rs @@ -36,7 +36,9 @@ mod _socket { #[cfg(windows)] mod c { pub use windows_sys::Win32::NetworkManagement::IpHelper::{if_indextoname, if_nametoindex}; - pub use windows_sys::Win32::Networking::WinSock::{INADDR_ANY, INADDR_LOOPBACK, INADDR_BROADCAST, INADDR_NONE}; + pub use windows_sys::Win32::Networking::WinSock::{ + INADDR_ANY, INADDR_BROADCAST, INADDR_LOOPBACK, INADDR_NONE, + }; pub use windows_sys::Win32::Networking::WinSock::{ AF_APPLETALK, AF_DECnet, AF_IPX, AF_LINK, AI_ADDRCONFIG, AI_ALL, AI_CANONNAME, @@ -1757,12 +1759,7 @@ mod _socket { .map(|s| s.to_cstring(vm)) .transpose()?; let cstr_proto = cstr_opt_as_ptr(&cstr_proto); - let serv = unsafe { - c::getservbyname( - cstr_name.as_ptr() as _, - cstr_proto as _, - ) - }; + let serv = unsafe { c::getservbyname(cstr_name.as_ptr() as _, cstr_proto as _) }; if serv.is_null() { return Err(vm.new_os_error("service/proto not found".to_owned())); } diff --git a/vm/src/stdlib/winapi.rs b/vm/src/stdlib/winapi.rs index 4a87a0f70f..7ffc4227e6 100644 --- a/vm/src/stdlib/winapi.rs +++ b/vm/src/stdlib/winapi.rs @@ -275,18 +275,14 @@ mod _winapi { Ok(( HANDLE(procinfo.hProcess as _), - HANDLE(procinfo.hThread as _), + HANDLE(procinfo.hThread as _), procinfo.dwProcessId, procinfo.dwThreadId, )) } #[pyfunction] - fn OpenProcess( - desired_access: u32, - inherit_handle: bool, - process_id: u32, - ) -> isize { + fn OpenProcess(desired_access: u32, inherit_handle: bool, process_id: u32) -> isize { unsafe { windows_sys::Win32::System::Threading::OpenProcess( desired_access, @@ -438,7 +434,8 @@ mod _winapi { #[pyfunction] fn WaitForSingleObject(h: HANDLE, ms: u32, vm: &VirtualMachine) -> PyResult { - let ret = unsafe { windows_sys::Win32::System::Threading::WaitForSingleObject(h.0 as _, ms) }; + let ret = + unsafe { windows_sys::Win32::System::Threading::WaitForSingleObject(h.0 as _, ms) }; if ret == windows_sys::Win32::Foundation::WAIT_FAILED { Err(errno_err(vm)) } else { @@ -512,6 +509,8 @@ mod _winapi { #[pyfunction] fn ReleaseMutex(handle: isize) -> WindowsSysResult { - WindowsSysResult(unsafe { windows_sys::Win32::System::Threading::ReleaseMutex(handle as _) }) + WindowsSysResult(unsafe { + windows_sys::Win32::System::Threading::ReleaseMutex(handle as _) + }) } }