1
Fork 0

Option and Result: Add references to documentation of as_ref and as_mut

This commit is contained in:
Chris Gregory 2019-03-15 16:42:10 -04:00
parent ad8a3eb039
commit 9a61580d40
2 changed files with 4 additions and 4 deletions

View file

@ -210,7 +210,7 @@ impl<T> Option<T> {
// Adapter for working with references
/////////////////////////////////////////////////////////////////////////
/// Converts from `Option<T>` to `Option<&T>`.
/// Converts from `&Option<T>` to `Option<&T>`.
///
/// # Examples
///
@ -239,7 +239,7 @@ impl<T> Option<T> {
}
}
/// Converts from `Option<T>` to `Option<&mut T>`.
/// Converts from `&mut Option<T>` to `Option<&mut T>`.
///
/// # Examples
///

View file

@ -369,7 +369,7 @@ impl<T, E> Result<T, E> {
// Adapter for working with references
/////////////////////////////////////////////////////////////////////////
/// Converts from `Result<T, E>` to `Result<&T, &E>`.
/// Converts from `&Result<T, E>` to `Result<&T, &E>`.
///
/// Produces a new `Result`, containing a reference
/// into the original, leaving the original in place.
@ -394,7 +394,7 @@ impl<T, E> Result<T, E> {
}
}
/// Converts from `Result<T, E>` to `Result<&mut T, &mut E>`.
/// Converts from `&mut Result<T, E>` to `Result<&mut T, &mut E>`.
///
/// # Examples
///