core: impl From<T> for Option<T>
This commit is contained in:
parent
fe5c439f69
commit
fbfee42a2f
@ -142,6 +142,7 @@
|
||||
use self::Option::*;
|
||||
|
||||
use clone::Clone;
|
||||
use convert::From;
|
||||
use default::Default;
|
||||
use iter::ExactSizeIterator;
|
||||
use iter::{Iterator, DoubleEndedIterator, FromIterator, IntoIterator};
|
||||
@ -754,6 +755,13 @@ impl<'a, T> IntoIterator for &'a mut Option<T> {
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(since = "1.12.0", feature = "option_from")]
|
||||
impl<T> From<T> for Option<T> {
|
||||
fn from(val: T) -> Option<T> {
|
||||
Some(val)
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// The Option Iterators
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
Reference in New Issue
Block a user