Skip to content

Commit 96fac0a

Browse files
committed
zephyr: Run rustfmt
Clean up formatting Signed-off-by: David Brown <[email protected]>
1 parent 70fe87c commit 96fac0a

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

zephyr/src/sys/sync/mutex.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ impl Mutex {
5252
///
5353
/// Create a new dynamically allocated Mutex. The Mutex can only be used from system threads.
5454
pub const fn new() -> Mutex {
55-
Mutex { item: <ZephyrObject<k_mutex>>::new_raw() }
55+
Mutex {
56+
item: <ZephyrObject<k_mutex>>::new_raw(),
57+
}
5658
}
5759

5860
/// Lock a Zephyr Mutex.
@@ -130,7 +132,9 @@ impl Condvar {
130132
///
131133
/// Create a new dynamically allocated Condvar. The Condvar can only be used from system threads.
132134
pub const fn new() -> Condvar {
133-
Condvar { item: <ZephyrObject<k_condvar>>::new_raw() }
135+
Condvar {
136+
item: <ZephyrObject<k_condvar>>::new_raw(),
137+
}
134138
}
135139

136140
/// Wait for someone else using this mutex/condvar pair to notify.

zephyr/src/work.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,13 @@ use zephyr_sys::{
194194
};
195195

196196
use crate::{
197-
error::to_result_void, kio::ContextExt, object::Fixed, simpletls::SimpleTls, sync::{Arc, Mutex},
198-
sys::thread::ThreadStack, time::Timeout,
197+
error::to_result_void,
198+
kio::ContextExt,
199+
object::Fixed,
200+
simpletls::SimpleTls,
201+
sync::{Arc, Mutex},
202+
sys::thread::ThreadStack,
203+
time::Timeout,
199204
};
200205

201206
pub mod futures;
@@ -275,7 +280,10 @@ impl WorkQueueBuilder {
275280
// SAFETY: This associates the workqueue with the thread ID that runs it. The thread is
276281
// a pointer into this work item, which will not move, because of the Fixed.
277282
let this = &mut *item.get();
278-
WORK_QUEUES.lock().unwrap().insert(&this.thread, WorkQueueRef(item.get()));
283+
WORK_QUEUES
284+
.lock()
285+
.unwrap()
286+
.insert(&this.thread, WorkQueueRef(item.get()));
279287

280288
// SAFETY: Start work queue thread. The main issue here is that the work queue cannot
281289
// be deallocated once the thread has started. We enforce this by making Drop panic.

0 commit comments

Comments
 (0)