diff options
| author | Ralf Jung <post@ralfj.de> | 2019-02-24 20:34:24 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2019-02-24 20:34:24 +0100 |
| commit | 6d32e5ae1a7a6cf7bc28f41d4c99ed81ac6113aa (patch) | |
| tree | 0c8874988947e0884d1dc738dc57bc124a04c373 | |
| parent | be8d728f3cb1cb79a630c6e6aba6df923dd3e999 (diff) | |
| download | rust-6d32e5ae1a7a6cf7bc28f41d4c99ed81ac6113aa.tar.gz rust-6d32e5ae1a7a6cf7bc28f41d4c99ed81ac6113aa.zip | |
prefer into_initialized over read_initialited
| -rw-r--r-- | src/libcore/mem.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libcore/mem.rs b/src/libcore/mem.rs index 967a36f6f1c..4b5056c5adf 100644 --- a/src/libcore/mem.rs +++ b/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 |
