Skip to content
Permalink
Browse files

prefer into_initialized over read_initialited

  • Loading branch information...
RalfJung committed Feb 24, 2019
1 parent be8d728 commit 6d32e5ae1a7a6cf7bc28f41d4c99ed81ac6113aa
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/libcore/mem.rs
@@ -1321,6 +1321,9 @@ impl<T> MaybeUninit<T> {
/// Reads the value from the `MaybeUninit<T>` container. The resulting `T` is subject
/// to the usual drop handling.
///
/// Whenever possible, it is preferrable to use [`into_initialized`] instead, which
/// prevents duplicating the content of the `MaybeUninit<T>`.
///
/// # Safety
///
/// It is up to the caller to guarantee that the `MaybeUninit<T>` really is in an initialized

0 comments on commit 6d32e5a

Please sign in to comment.
You can’t perform that action at this time.