Add missing default implementations

This commit is contained in:
Gwilym Inzani 2024-02-28 09:55:55 +00:00
parent b5c97afe61
commit 941eb4ade1
2 changed files with 12 additions and 0 deletions

View file

@ -52,6 +52,12 @@ impl RandomNumberGenerator {
}
}
impl Default for RandomNumberGenerator {
fn default() -> Self {
Self::new()
}
}
static GLOBAL_RNG: Mutex<RefCell<RandomNumberGenerator>> =
Mutex::new(RefCell::new(RandomNumberGenerator::new()));

View file

@ -60,6 +60,12 @@ impl RawMutex {
unsafe impl Send for RawMutex {}
unsafe impl Sync for RawMutex {}
impl Default for RawMutex {
fn default() -> Self {
Self::new()
}
}
/// A guard representing an active lock on an [`RawMutex`].
pub struct RawMutexGuard<'a>(&'a RawMutex);
impl<'a> Drop for RawMutexGuard<'a> {