From 6a03bf052ad074bd13552c1654c012f9f4072b6e Mon Sep 17 00:00:00 2001 From: Jacob Rothstein Date: Fri, 29 Mar 2024 05:18:06 -0700 Subject: [PATCH] Add Cell::into_inner (#341) --- 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 {