Skip to content

Commit 6a6c02a

Browse files
committed
Rollup merge of #24298 - White-Oak:master, r=alexcrichton
Fixes 'fn from_str_radix' documentation where docs meant that Option is returned, though the function returns Result.
2 parents a7c5f51 + b4c49ba commit 6a6c02a

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

src/libcore/num/mod.rs

+8-11
Original file line numberDiff line numberDiff line change
@@ -856,9 +856,8 @@ macro_rules! int_impl {
856856
///
857857
/// # Return value
858858
///
859-
/// `None` if the string did not represent a valid number.
860-
/// Otherwise, `Some(n)` where `n` is the integer represented
861-
/// by `src`.
859+
/// `Err(ParseIntError)` if the string did not represent a valid number.
860+
/// Otherwise, `Ok(n)` where `n` is the integer represented by `src`.
862861
#[stable(feature = "rust1", since = "1.0.0")]
863862
#[allow(deprecated)]
864863
pub fn from_str_radix(src: &str, radix: u32) -> Result<$T, ParseIntError> {
@@ -1373,9 +1372,8 @@ macro_rules! uint_impl {
13731372
///
13741373
/// # Return value
13751374
///
1376-
/// `None` if the string did not represent a valid number.
1377-
/// Otherwise, `Some(n)` where `n` is the integer represented
1378-
/// by `src`.
1375+
/// `Err(ParseIntError)` if the string did not represent a valid number.
1376+
/// Otherwise, `Ok(n)` where `n` is the integer represented by `src`.
13791377
#[stable(feature = "rust1", since = "1.0.0")]
13801378
#[allow(deprecated)]
13811379
pub fn from_str_radix(src: &str, radix: u32) -> Result<$T, ParseIntError> {
@@ -2707,8 +2705,8 @@ macro_rules! from_str_radix_float_impl {
27072705
///
27082706
/// # Return value
27092707
///
2710-
/// `None` if the string did not represent a valid number. Otherwise,
2711-
/// `Some(n)` where `n` is the floating-point number represented by `src`.
2708+
/// `Err(ParseIntError)` if the string did not represent a valid number. Otherwise,
2709+
/// Otherwise, `Ok(n)` where `n` is the floating-point number represented by `src`.
27122710
#[inline]
27132711
#[allow(deprecated)]
27142712
fn from_str(src: &str) -> Result<$T, ParseFloatError> {
@@ -2736,9 +2734,8 @@ macro_rules! from_str_radix_float_impl {
27362734
///
27372735
/// # Return value
27382736
///
2739-
/// `None` if the string did not represent a valid number.
2740-
/// Otherwise, `Some(n)` where `n` is the floating-point number
2741-
/// represented by `src`.
2737+
/// `Err(ParseIntError)` if the string did not represent a valid number. Otherwise,
2738+
/// Otherwise, `Ok(n)` where `n` is the floating-point number represented by `src`.
27422739
fn from_str_radix(src: &str, radix: u32)
27432740
-> Result<$T, ParseFloatError> {
27442741
use self::FloatErrorKind::*;

0 commit comments

Comments
 (0)