Skip to content

Commit

Permalink
Clean up cell crates
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Spinale <[email protected]>
  • Loading branch information
nspin committed Oct 2, 2023
1 parent 17dad86 commit 72ef2ff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions crates/sel4-immediate-sync-once-cell/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ pub struct ImmediateSyncOnceCell<T> {
inner: SyncUnsafeCell<Option<T>>,
}

impl<T> Default for ImmediateSyncOnceCell<T> {
fn default() -> Self {
Self::new()
}
}

impl<T> ImmediateSyncOnceCell<T> {
pub const fn new() -> Self {
Self {
Expand Down
8 changes: 4 additions & 4 deletions crates/sel4-immutable-cell/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ pub struct ImmutableCell<T: ?Sized> {
}

impl<T: Default> Default for ImmutableCell<T> {
fn default() -> ImmutableCell<T> {
ImmutableCell::new(Default::default())
fn default() -> Self {
Self::new(Default::default())
}
}

impl<T> From<T> for ImmutableCell<T> {
fn from(t: T) -> ImmutableCell<T> {
ImmutableCell::new(t)
fn from(t: T) -> Self {
Self::new(t)
}
}

Expand Down

0 comments on commit 72ef2ff

Please sign in to comment.