From 2bf9fbc8d61e2283cd6133b96cff2e04988bbe69 Mon Sep 17 00:00:00 2001 From: Brad Gibson Date: Fri, 27 Apr 2018 06:36:37 -0700 Subject: [PATCH] separated inner_deref Result impls --- src/libcore/result.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/libcore/result.rs b/src/libcore/result.rs index 9e302cb9f968..c545064aadb2 100644 --- a/src/libcore/result.rs +++ b/src/libcore/result.rs @@ -910,7 +910,7 @@ impl Result { } #[unstable(feature = "inner_deref", reason = "newly added", issue = "50264")] -impl Result { +impl Result { /// Converts from `&Result` to `Result<&T::Target, &E>`. /// /// Leaves the original Result in-place, creating a new one with a reference @@ -919,7 +919,10 @@ impl Result { pub fn deref_ok(&self) -> Result<&T::Target, &E> { self.as_ref().map(|t| t.deref()) } +} +#[unstable(feature = "inner_deref", reason = "newly added", issue = "50264")] +impl Result { /// Converts from `&Result` to `Result<&T, &E::Target>`. /// /// Leaves the original Result in-place, creating a new one with a reference @@ -929,7 +932,10 @@ impl Result { { self.as_ref().map_err(|e| e.deref()) } +} +#[unstable(feature = "inner_deref", reason = "newly added", issue = "50264")] +impl Result { /// Converts from `&Result` to `Result<&T::Target, &E::Target>`. /// /// Leaves the original Result in-place, creating a new one with a reference