Skip to content

Commit b4929d2

Browse files
arihant2mathcoolreader18
authored andcommitted
formatting
1 parent ddf2e59 commit b4929d2

4 files changed

Lines changed: 18 additions & 17 deletions

File tree

common/src/fileutils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ pub mod windows {
153153

154154
let p_id_info = if unsafe {
155155
GetFileInformationByHandleEx(
156-
h as _,
156+
h as _,
157157
FileIdInfo,
158158
&mut id_info as *mut _ as *mut _,
159159
std::mem::size_of_val(&id_info) as u32,

stdlib/src/overlapped.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,12 @@ mod _overlapped {
303303
vm: &VirtualMachine,
304304
) -> PyResult<isize> {
305305
let r = unsafe {
306-
windows_sys::Win32::System::IO::CreateIoCompletionPort(handle as _, port as _, key, concurrency) as isize
306+
windows_sys::Win32::System::IO::CreateIoCompletionPort(
307+
handle as _,
308+
port as _,
309+
key,
310+
concurrency,
311+
) as isize
307312
};
308313
if r as usize == 0 {
309314
return Err(errno_err(vm));

stdlib/src/socket.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ mod _socket {
3636
#[cfg(windows)]
3737
mod c {
3838
pub use windows_sys::Win32::NetworkManagement::IpHelper::{if_indextoname, if_nametoindex};
39-
pub use windows_sys::Win32::Networking::WinSock::{INADDR_ANY, INADDR_LOOPBACK, INADDR_BROADCAST, INADDR_NONE};
39+
pub use windows_sys::Win32::Networking::WinSock::{
40+
INADDR_ANY, INADDR_BROADCAST, INADDR_LOOPBACK, INADDR_NONE,
41+
};
4042

4143
pub use windows_sys::Win32::Networking::WinSock::{
4244
AF_APPLETALK, AF_DECnet, AF_IPX, AF_LINK, AI_ADDRCONFIG, AI_ALL, AI_CANONNAME,
@@ -1757,12 +1759,7 @@ mod _socket {
17571759
.map(|s| s.to_cstring(vm))
17581760
.transpose()?;
17591761
let cstr_proto = cstr_opt_as_ptr(&cstr_proto);
1760-
let serv = unsafe {
1761-
c::getservbyname(
1762-
cstr_name.as_ptr() as _,
1763-
cstr_proto as _,
1764-
)
1765-
};
1762+
let serv = unsafe { c::getservbyname(cstr_name.as_ptr() as _, cstr_proto as _) };
17661763
if serv.is_null() {
17671764
return Err(vm.new_os_error("service/proto not found".to_owned()));
17681765
}

vm/src/stdlib/winapi.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -275,18 +275,14 @@ mod _winapi {
275275

276276
Ok((
277277
HANDLE(procinfo.hProcess as _),
278-
HANDLE(procinfo.hThread as _),
278+
HANDLE(procinfo.hThread as _),
279279
procinfo.dwProcessId,
280280
procinfo.dwThreadId,
281281
))
282282
}
283283

284284
#[pyfunction]
285-
fn OpenProcess(
286-
desired_access: u32,
287-
inherit_handle: bool,
288-
process_id: u32,
289-
) -> isize {
285+
fn OpenProcess(desired_access: u32, inherit_handle: bool, process_id: u32) -> isize {
290286
unsafe {
291287
windows_sys::Win32::System::Threading::OpenProcess(
292288
desired_access,
@@ -438,7 +434,8 @@ mod _winapi {
438434

439435
#[pyfunction]
440436
fn WaitForSingleObject(h: HANDLE, ms: u32, vm: &VirtualMachine) -> PyResult<u32> {
441-
let ret = unsafe { windows_sys::Win32::System::Threading::WaitForSingleObject(h.0 as _, ms) };
437+
let ret =
438+
unsafe { windows_sys::Win32::System::Threading::WaitForSingleObject(h.0 as _, ms) };
442439
if ret == windows_sys::Win32::Foundation::WAIT_FAILED {
443440
Err(errno_err(vm))
444441
} else {
@@ -512,6 +509,8 @@ mod _winapi {
512509

513510
#[pyfunction]
514511
fn ReleaseMutex(handle: isize) -> WindowsSysResult<BOOL> {
515-
WindowsSysResult(unsafe { windows_sys::Win32::System::Threading::ReleaseMutex(handle as _) })
512+
WindowsSysResult(unsafe {
513+
windows_sys::Win32::System::Threading::ReleaseMutex(handle as _)
514+
})
516515
}
517516
}

0 commit comments

Comments
 (0)