Also add a From implementation for &mut Option<T> -> `Option<&mut T>'
This commit is contained in:
parent
0cde1cbb10
commit
a7a0225a28
1 changed files with 7 additions and 0 deletions
|
|
@ -1071,6 +1071,13 @@ impl<'a, T> From<&'a Option<T>> for Option<&'a T> {
|
|||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "option_ref_from_ref_option", since = "1.30.0")]
|
||||
impl<'a, T> From<&'a mut Option<T>> for Option<&'a mut T> {
|
||||
fn from(o: &'a mut Option<T>) -> Option<&'a mut T> {
|
||||
o.as_mut()
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// The Option Iterators
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue