diff --git a/agb/src/rng.rs b/agb/src/rng.rs index f0ef404f..b98ad6ce 100644 --- a/agb/src/rng.rs +++ b/agb/src/rng.rs @@ -52,6 +52,12 @@ impl RandomNumberGenerator { } } +impl Default for RandomNumberGenerator { + fn default() -> Self { + Self::new() + } +} + static GLOBAL_RNG: Mutex> = Mutex::new(RefCell::new(RandomNumberGenerator::new())); diff --git a/agb/src/sync/locks.rs b/agb/src/sync/locks.rs index fdb7033f..18155522 100644 --- a/agb/src/sync/locks.rs +++ b/agb/src/sync/locks.rs @@ -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> {