diff --git a/src/libcore/option.rs b/src/libcore/option.rs index 2b6c376f8a7..ad69d137685 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -1064,6 +1064,12 @@ impl From for Option { } } +impl<'a, T> From<&'a Option> for Option<&'a T> { + fn from(o: &'a Option) -> Option<&'a T> { + o.as_ref() + } +} + ///////////////////////////////////////////////////////////////////////////// // The Option Iterators /////////////////////////////////////////////////////////////////////////////