From 97be6d35ceaa7fd4dfbbc88428d9a1b5ccf58a3e Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 21 Dec 2017 12:28:30 -0800 Subject: [PATCH] Add `get_mut` to `WasmRefCell` --- src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index c2f44a07..481bcd4f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -113,6 +113,12 @@ pub mod __rt { } } + pub fn get_mut(&mut self) -> &mut T { + unsafe { + &mut *self.value.get() + } + } + pub fn borrow(&self) -> Ref { unsafe { if self.borrow.get() == usize::max_value() {