Add a implementation of From
for converting &'a Option<T>
into
`Option<&'a T>`
This commit is contained in:
parent
76b69a604e
commit
ef519c1de5
@ -1064,6 +1064,12 @@ fn from(val: T) -> Option<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T> From<&'a Option<T>> for Option<&'a T> {
|
||||
fn from(o: &'a Option<T>) -> Option<&'a T> {
|
||||
o.as_ref()
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// The Option Iterators
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
Reference in New Issue
Block a user