Skip to content

Commit

Permalink
prefer into_initialized over read_initialited
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Feb 24, 2019
1 parent be8d728 commit 6d32e5a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/libcore/mem.rs
Expand Up @@ -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
Expand Down

0 comments on commit 6d32e5a

Please sign in to comment.