Skip to content

Commit ef8baea

Browse files
committed
"format"
1 parent 7c4738e commit ef8baea

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

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

+3-4
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ impl Mutex {
135135
n => return n as *const _,
136136
}
137137
unsafe {
138-
let inner = box Inner { remutex: ReentrantMutex::uninitialized(), held: Cell::new(false) };
138+
let inner =
139+
box Inner { remutex: ReentrantMutex::uninitialized(), held: Cell::new(false) };
139140
inner.remutex.init();
140141
let inner = Box::into_raw(inner);
141142
match self.lock.compare_and_swap(0, inner as usize, Ordering::SeqCst) {
@@ -182,9 +183,7 @@ impl ReentrantMutex {
182183
#[inline]
183184
pub unsafe fn try_lock(&self) -> bool {
184185
// SAFETY: The caller must ensure that the mutex is not moved or copied
185-
unsafe {
186-
c::TryEnterCriticalSection(UnsafeCell::raw_get(self.inner.as_ptr())) != 0
187-
}
186+
unsafe { c::TryEnterCriticalSection(UnsafeCell::raw_get(self.inner.as_ptr())) != 0 }
188187
}
189188

190189
pub unsafe fn unlock(&self) {

0 commit comments

Comments
 (0)