Add get_mut to WasmRefCell

This commit is contained in:
Alex Crichton 2017-12-21 12:28:30 -08:00
parent 44a9555313
commit 97be6d35ce

View File

@ -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<T> {
unsafe {
if self.borrow.get() == usize::max_value() {