Skip to content

Commit

Permalink
Add Cell::into_inner (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbr committed Mar 29, 2024
1 parent 753befd commit 6a03bf0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/cell/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ impl<T> Cell<T> {
{
self.replace(T::default())
}

/// Unwraps the value, consuming the cell.
#[track_caller]
pub fn into_inner(self) -> T {
self.cell.into_inner()
}
}

impl<T: Default> Default for Cell<T> {
Expand Down

0 comments on commit 6a03bf0

Please sign in to comment.