From d560b50d87c05ea5a8e6186c05a50ecd828eaaae Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Tue, 6 Oct 2020 12:12:15 +0200 Subject: [PATCH] revise code to pass the format check --- library/std/src/sys/hermit/mutex.rs | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/library/std/src/sys/hermit/mutex.rs b/library/std/src/sys/hermit/mutex.rs index 511a5100ac6..bd9a9023396 100644 --- a/library/std/src/sys/hermit/mutex.rs +++ b/library/std/src/sys/hermit/mutex.rs @@ -3,7 +3,7 @@ use crate::collections::VecDeque; use crate::ffi::c_void; use crate::ops::{Deref, DerefMut, Drop}; use crate::ptr; -use crate::sync::atomic::{AtomicUsize, Ordering, spin_loop_hint}; +use crate::sync::atomic::{spin_loop_hint, AtomicUsize, Ordering}; use crate::sys::hermit::abi; /// This type provides a lock based on busy waiting to realize mutual exclusion @@ -50,10 +50,7 @@ impl Spinlock { #[inline] pub unsafe fn lock(&self) -> SpinlockGuard<'_, T> { self.obtain_lock(); - SpinlockGuard { - dequeue: &self.dequeue, - data: &mut *self.data.get(), - } + SpinlockGuard { dequeue: &self.dequeue, data: &mut *self.data.get() } } } @@ -147,10 +144,7 @@ struct MutexInner { impl MutexInner { pub const fn new() -> MutexInner { - MutexInner { - locked: false, - blocked_task: PriorityQueue::new(), - } + MutexInner { locked: false, blocked_task: PriorityQueue::new() } } } @@ -163,9 +157,7 @@ unsafe impl Sync for Mutex {} impl Mutex { pub const fn new() -> Mutex { - Mutex { - inner: Spinlock::new(MutexInner::new()), - } + Mutex { inner: Spinlock::new(MutexInner::new()) } } #[inline] @@ -211,8 +203,7 @@ impl Mutex { } #[inline] - pub unsafe fn destroy(&self) { - } + pub unsafe fn destroy(&self) {} } pub struct ReentrantMutex {