Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit d560b50

Browse files
committed
revise code to pass the format check
1 parent 98fcc3f commit d560b50

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

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

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use crate::collections::VecDeque;
33
use crate::ffi::c_void;
44
use crate::ops::{Deref, DerefMut, Drop};
55
use crate::ptr;
6-
use crate::sync::atomic::{AtomicUsize, Ordering, spin_loop_hint};
6+
use crate::sync::atomic::{spin_loop_hint, AtomicUsize, Ordering};
77
use crate::sys::hermit::abi;
88

99
/// This type provides a lock based on busy waiting to realize mutual exclusion
@@ -50,10 +50,7 @@ impl<T> Spinlock<T> {
5050
#[inline]
5151
pub unsafe fn lock(&self) -> SpinlockGuard<'_, T> {
5252
self.obtain_lock();
53-
SpinlockGuard {
54-
dequeue: &self.dequeue,
55-
data: &mut *self.data.get(),
56-
}
53+
SpinlockGuard { dequeue: &self.dequeue, data: &mut *self.data.get() }
5754
}
5855
}
5956

@@ -147,10 +144,7 @@ struct MutexInner {
147144

148145
impl MutexInner {
149146
pub const fn new() -> MutexInner {
150-
MutexInner {
151-
locked: false,
152-
blocked_task: PriorityQueue::new(),
153-
}
147+
MutexInner { locked: false, blocked_task: PriorityQueue::new() }
154148
}
155149
}
156150

@@ -163,9 +157,7 @@ unsafe impl Sync for Mutex {}
163157

164158
impl Mutex {
165159
pub const fn new() -> Mutex {
166-
Mutex {
167-
inner: Spinlock::new(MutexInner::new()),
168-
}
160+
Mutex { inner: Spinlock::new(MutexInner::new()) }
169161
}
170162

171163
#[inline]
@@ -211,8 +203,7 @@ impl Mutex {
211203
}
212204

213205
#[inline]
214-
pub unsafe fn destroy(&self) {
215-
}
206+
pub unsafe fn destroy(&self) {}
216207
}
217208

218209
pub struct ReentrantMutex {

0 commit comments

Comments
 (0)