prefer into_initialized over read_initialited

This commit is contained in:
Ralf Jung 2019-02-24 20:34:24 +01:00
parent be8d728f3c
commit 6d32e5ae1a

View file

@ -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