Skip to content

Commit 70521c3

Browse files
Auto-format: cargo fmt --all
1 parent cfda437 commit 70521c3

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

crates/stdlib/src/overlapped.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1586,9 +1586,10 @@ mod _overlapped {
15861586
std::sync::Mutex<std::collections::HashMap<isize, CallbackDataPtr>>,
15871587
> = std::sync::OnceLock::new();
15881588

1589-
fn wait_callback_registry(
1590-
) -> &'static std::sync::Mutex<std::collections::HashMap<isize, CallbackDataPtr>> {
1591-
WAIT_CALLBACK_REGISTRY.get_or_init(|| std::sync::Mutex::new(std::collections::HashMap::new()))
1589+
fn wait_callback_registry()
1590+
-> &'static std::sync::Mutex<std::collections::HashMap<isize, CallbackDataPtr>> {
1591+
WAIT_CALLBACK_REGISTRY
1592+
.get_or_init(|| std::sync::Mutex::new(std::collections::HashMap::new()))
15921593
}
15931594

15941595
// Callback data for RegisterWaitWithQueue
@@ -1613,9 +1614,14 @@ mod _overlapped {
16131614
(*data).overlapped,
16141615
);
16151616
// Try to claim ownership for freeing
1616-
if !(*data).freed.swap(true, std::sync::atomic::Ordering::AcqRel) {
1617+
if !(*data)
1618+
.freed
1619+
.swap(true, std::sync::atomic::Ordering::AcqRel)
1620+
{
16171621
// Remove from registry
1618-
let wait_handle = (*data).wait_handle.load(std::sync::atomic::Ordering::Acquire);
1622+
let wait_handle = (*data)
1623+
.wait_handle
1624+
.load(std::sync::atomic::Ordering::Acquire);
16191625
if wait_handle != 0
16201626
&& let Ok(mut registry) = wait_callback_registry().lock()
16211627
{

0 commit comments

Comments
 (0)