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);