1
Fork 0

“Moves” instead of “copies” in <Option<T> as From<T>>::from doc.

This implementation has no `Copy` or `Clone` bound, so its operation is
guaranteed to be a move. The call site might copy, but the function
itself cannot.

Also linkify `Some` while we're touching the line anyway.
This commit is contained in:
Kevin Reid 2021-09-04 11:05:36 -07:00
parent 226e181b80
commit 34c1fce50b

View file

@ -1701,7 +1701,7 @@ impl<'a, T> IntoIterator for &'a mut Option<T> {
#[stable(since = "1.12.0", feature = "option_from")]
impl<T> From<T> for Option<T> {
/// Copies `val` into a new `Some`.
/// Moves `val` into a new [`Some`].
///
/// # Examples
///