From c0ce57596b9af43a713f236c2e933346b9b77678 Mon Sep 17 00:00:00 2001 From: Jacob Rothstein Date: Thu, 28 Mar 2024 14:16:15 -0700 Subject: [PATCH] feat: add loom::cell::Cell::into_inner --- src/cell/cell.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/cell/cell.rs b/src/cell/cell.rs index 37d76dde..fc14861d 100644 --- a/src/cell/cell.rs +++ b/src/cell/cell.rs @@ -67,6 +67,12 @@ impl Cell { { self.replace(T::default()) } + + /// Unwraps the value, consuming the cell. + #[track_caller] + pub fn into_inner(self) -> T { + self.cell.into_inner() + } } impl Default for Cell {