From 9e814251df561b931e12d5b92c05f1c4045de49d Mon Sep 17 00:00:00 2001 From: Ruihan Li Date: Tue, 3 Dec 2024 10:29:00 +0800 Subject: [PATCH] Remove unnecessary trait bounds --- ostd/src/sync/spin.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ostd/src/sync/spin.rs b/ostd/src/sync/spin.rs index a8211f799..3f7b0ab0b 100644 --- a/ostd/src/sync/spin.rs +++ b/ostd/src/sync/spin.rs @@ -32,7 +32,7 @@ use crate::{ /// /// [`disable_irq`]: Self::disable_irq #[repr(transparent)] -pub struct SpinLock { +pub struct SpinLock { phantom: PhantomData, /// Only the last field of a struct may have a dynamically sized type. /// That's why SpinLockInner is put in the last field. @@ -92,7 +92,7 @@ impl Guardian for LocalIrqDisabled { } } -impl SpinLock { +impl SpinLock { /// Creates a new spin lock. pub const fn new(val: T) -> Self { let lock_inner = SpinLockInner { @@ -179,15 +179,15 @@ impl SpinLock { } } -impl fmt::Debug for SpinLock { +impl fmt::Debug for SpinLock { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::Debug::fmt(&self.inner.val, f) } } // SAFETY: Only a single lock holder is permitted to access the inner data of Spinlock. -unsafe impl Send for SpinLock {} -unsafe impl Sync for SpinLock {} +unsafe impl Send for SpinLock {} +unsafe impl Sync for SpinLock {} /// A guard that provides exclusive access to the data protected by a [`SpinLock`]. pub type SpinLockGuard<'a, T, G> = SpinLockGuard_, G>;