From 2e3a88999154952bd1c3c557695cdb46d930104d Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Fri, 9 Aug 2019 14:57:12 +0200 Subject: [PATCH] Added get_mut and get_ref into the nightly as well --- src/export.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/export.rs b/src/export.rs index a0d40a93bb..e75d25ad2b 100644 --- a/src/export.rs +++ b/src/export.rs @@ -82,21 +82,19 @@ impl MaybeUninit { self.inner.as_mut_ptr() } - #[cfg(feature = "nightly")] - pub fn write(&mut self, value: T) -> &mut T { - self.inner.write(value) - } - - #[cfg(not(feature = "nightly"))] pub unsafe fn get_ref(&self) -> &T { &*self.inner.as_ptr() } - #[cfg(not(feature = "nightly"))] pub unsafe fn get_mut(&mut self) -> &mut T { &mut *self.inner.as_mut_ptr() } + #[cfg(feature = "nightly")] + pub fn write(&mut self, value: T) -> &mut T { + self.inner.write(value) + } + #[cfg(not(feature = "nightly"))] pub fn write(&mut self, value: T) -> &mut T { self.inner = core::mem::MaybeUninit::new(value);