From 72ef2ffd6be429d7ce276ac153f2afb7d81b4e5b Mon Sep 17 00:00:00 2001 From: Nick Spinale Date: Sat, 30 Sep 2023 08:37:35 +0000 Subject: [PATCH] Clean up cell crates Signed-off-by: Nick Spinale --- crates/sel4-immediate-sync-once-cell/src/lib.rs | 6 ++++++ crates/sel4-immutable-cell/src/lib.rs | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/crates/sel4-immediate-sync-once-cell/src/lib.rs b/crates/sel4-immediate-sync-once-cell/src/lib.rs index 7ed61bdd6..f9a18f497 100644 --- a/crates/sel4-immediate-sync-once-cell/src/lib.rs +++ b/crates/sel4-immediate-sync-once-cell/src/lib.rs @@ -10,6 +10,12 @@ pub struct ImmediateSyncOnceCell { inner: SyncUnsafeCell>, } +impl Default for ImmediateSyncOnceCell { + fn default() -> Self { + Self::new() + } +} + impl ImmediateSyncOnceCell { pub const fn new() -> Self { Self { diff --git a/crates/sel4-immutable-cell/src/lib.rs b/crates/sel4-immutable-cell/src/lib.rs index 25288d1dd..83bc18188 100644 --- a/crates/sel4-immutable-cell/src/lib.rs +++ b/crates/sel4-immutable-cell/src/lib.rs @@ -9,14 +9,14 @@ pub struct ImmutableCell { } impl Default for ImmutableCell { - fn default() -> ImmutableCell { - ImmutableCell::new(Default::default()) + fn default() -> Self { + Self::new(Default::default()) } } impl From for ImmutableCell { - fn from(t: T) -> ImmutableCell { - ImmutableCell::new(t) + fn from(t: T) -> Self { + Self::new(t) } }