Skip to content

Commit 6d32e5a

Browse files
committed
prefer into_initialized over read_initialited
1 parent be8d728 commit 6d32e5a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/libcore/mem.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1321,6 +1321,9 @@ impl<T> MaybeUninit<T> {
13211321
/// Reads the value from the `MaybeUninit<T>` container. The resulting `T` is subject
13221322
/// to the usual drop handling.
13231323
///
1324+
/// Whenever possible, it is preferrable to use [`into_initialized`] instead, which
1325+
/// prevents duplicating the content of the `MaybeUninit<T>`.
1326+
///
13241327
/// # Safety
13251328
///
13261329
/// It is up to the caller to guarantee that the `MaybeUninit<T>` really is in an initialized

0 commit comments

Comments
 (0)