1068: Add Default to some types r=Dirbaio a=mkj

These are a couple of places I've found `Default` to be handy

Co-authored-by: Matt Johnston <matt@ucc.asn.au>
This commit is contained in:
bors[bot] 2022-11-22 15:04:24 +00:00 committed by GitHub
commit 61be0e75c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -56,6 +56,15 @@ where
} }
} }
impl<M, T> Default for Signal<M, T>
where
M: RawMutex,
{
fn default() -> Self {
Self::new()
}
}
impl<M, T: Send> Signal<M, T> impl<M, T: Send> Signal<M, T>
where where
M: RawMutex, M: RawMutex,

View File

@ -6,7 +6,7 @@ use crate::blocking_mutex::raw::CriticalSectionRawMutex;
use crate::blocking_mutex::Mutex; use crate::blocking_mutex::Mutex;
/// Utility struct to register and wake a waker. /// Utility struct to register and wake a waker.
#[derive(Debug)] #[derive(Debug, Default)]
pub struct WakerRegistration { pub struct WakerRegistration {
waker: Option<Waker>, waker: Option<Waker>,
} }