From c7697ee86dea35e2be3476c10cc4d9fe48ff7859 Mon Sep 17 00:00:00 2001 From: Oak Date: Fri, 10 Apr 2015 23:16:47 +0400 Subject: [PATCH 1/2] mod.rs docs fix Docs meant that Option is returned though the function returns Result. --- src/libcore/num/mod.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 7868e299cfcad..b826609bb7d9b 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -856,9 +856,8 @@ macro_rules! int_impl { /// /// # Return value /// - /// `None` if the string did not represent a valid number. - /// Otherwise, `Some(n)` where `n` is the integer represented - /// by `src`. + /// `Err(ParseIntError)` if the string did not represent a valid number. + /// Otherwise, `Ok(n)` where `n` is the integer represented by `src`. #[stable(feature = "rust1", since = "1.0.0")] #[allow(deprecated)] pub fn from_str_radix(src: &str, radix: u32) -> Result<$T, ParseIntError> { @@ -1374,9 +1373,8 @@ macro_rules! uint_impl { /// /// # Return value /// - /// `None` if the string did not represent a valid number. - /// Otherwise, `Some(n)` where `n` is the integer represented - /// by `src`. + /// `Err(ParseIntError)` if the string did not represent a valid number. + /// Otherwise, `Ok(n)` where `n` is the integer represented by `src`. #[stable(feature = "rust1", since = "1.0.0")] #[allow(deprecated)] pub fn from_str_radix(src: &str, radix: u32) -> Result<$T, ParseIntError> { From b4c49ba2127a1bf0457cabf110a7389928be6488 Mon Sep 17 00:00:00 2001 From: Oak Date: Fri, 10 Apr 2015 23:20:40 +0400 Subject: [PATCH 2/2] mod.rs docs fix - for floats MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Same with integers — docs meant that Option is returned though the function returns Result. --- src/libcore/num/mod.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index b826609bb7d9b..8d3b780b1b302 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -2705,8 +2705,8 @@ macro_rules! from_str_radix_float_impl { /// /// # Return value /// - /// `None` if the string did not represent a valid number. Otherwise, - /// `Some(n)` where `n` is the floating-point number represented by `src`. + /// `Err(ParseIntError)` if the string did not represent a valid number. Otherwise, + /// Otherwise, `Ok(n)` where `n` is the floating-point number represented by `src`. #[inline] #[allow(deprecated)] fn from_str(src: &str) -> Result<$T, ParseFloatError> { @@ -2734,9 +2734,8 @@ macro_rules! from_str_radix_float_impl { /// /// # Return value /// - /// `None` if the string did not represent a valid number. - /// Otherwise, `Some(n)` where `n` is the floating-point number - /// represented by `src`. + /// `Err(ParseIntError)` if the string did not represent a valid number. Otherwise, + /// Otherwise, `Ok(n)` where `n` is the floating-point number represented by `src`. fn from_str_radix(src: &str, radix: u32) -> Result<$T, ParseFloatError> { use self::FloatErrorKind::*;