diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2015-02-15 00:10:19 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2015-02-15 00:10:19 +0300 |
| commit | b1cd76906a4c7e40e3eb3569450d2dbd3be9fcab (patch) | |
| tree | 6baeb7435c09f6d648d9fb2fa42a1210a16fe489 /src/libcore | |
| parent | 09f53fd45c14a9fb796eca54a8954e943bf09477 (diff) | |
| download | rust-b1cd76906a4c7e40e3eb3569450d2dbd3be9fcab.tar.gz rust-b1cd76906a4c7e40e3eb3569450d2dbd3be9fcab.zip | |
Fix the fallout
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/fmt/float.rs | 10 | ||||
| -rw-r--r-- | src/libcore/num/mod.rs | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/libcore/fmt/float.rs b/src/libcore/fmt/float.rs index 25bb959b9b3..8e09e52daee 100644 --- a/src/libcore/fmt/float.rs +++ b/src/libcore/fmt/float.rs @@ -53,7 +53,7 @@ pub enum SignFormat { SignNeg } -static DIGIT_E_RADIX: uint = ('e' as uint) - ('a' as uint) + 11; +static DIGIT_E_RADIX: u32 = ('e' as u32) - ('a' as u32) + 11; /// Converts a number to its string representation as a byte vector. /// This is meant to be a common base implementation for all numeric string @@ -87,7 +87,7 @@ static DIGIT_E_RADIX: uint = ('e' as uint) - ('a' as uint) + 11; /// between digit and exponent sign `'p'`. pub fn float_to_str_bytes_common<T: Float, U, F>( num: T, - radix: uint, + radix: u32, negative_zero: bool, sign: SignFormat, digits: SignificantDigits, @@ -156,7 +156,7 @@ pub fn float_to_str_bytes_common<T: Float, U, F>( deccum = deccum / radix_gen; deccum = deccum.trunc(); - let c = char::from_digit(current_digit.to_int().unwrap() as uint, radix); + let c = char::from_digit(current_digit.to_int().unwrap() as u32, radix); buf[end] = c.unwrap() as u8; end += 1; @@ -211,7 +211,7 @@ pub fn float_to_str_bytes_common<T: Float, U, F>( // See note in first loop. let current_digit = deccum.trunc().abs(); - let c = char::from_digit(current_digit.to_int().unwrap() as uint, + let c = char::from_digit(current_digit.to_int().unwrap() as u32, radix); buf[end] = c.unwrap() as u8; end += 1; @@ -228,7 +228,7 @@ pub fn float_to_str_bytes_common<T: Float, U, F>( let ascii2value = |chr: u8| { (chr as char).to_digit(radix).unwrap() }; - let value2ascii = |val: uint| { + let value2ascii = |val: u32| { char::from_digit(val, radix).unwrap() as u8 }; diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index b7c5c6640ce..d6c01ddc74a 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -1432,12 +1432,12 @@ pub trait Float #[unstable(feature = "core", reason = "needs reevaluation")] pub trait FromStrRadix { type Err; - fn from_str_radix(str: &str, radix: uint) -> Result<Self, Self::Err>; + fn from_str_radix(str: &str, radix: u32) -> Result<Self, Self::Err>; } /// A utility function that just calls FromStrRadix::from_str_radix. #[unstable(feature = "core", reason = "needs reevaluation")] -pub fn from_str_radix<T: FromStrRadix>(str: &str, radix: uint) +pub fn from_str_radix<T: FromStrRadix>(str: &str, radix: u32) -> Result<T, T::Err> { FromStrRadix::from_str_radix(str, radix) } @@ -1501,7 +1501,7 @@ macro_rules! from_str_radix_float_impl { /// `None` if the string did not represent a valid number. /// Otherwise, `Some(n)` where `n` is the floating-point number /// represented by `src`. - fn from_str_radix(src: &str, radix: uint) + fn from_str_radix(src: &str, radix: u32) -> Result<$T, ParseFloatError> { use self::FloatErrorKind::*; use self::ParseFloatError as PFE; @@ -1661,7 +1661,7 @@ macro_rules! from_str_radix_int_impl { #[stable(feature = "rust1", since = "1.0.0")] impl FromStrRadix for $T { type Err = ParseIntError; - fn from_str_radix(src: &str, radix: uint) + fn from_str_radix(src: &str, radix: u32) -> Result<$T, ParseIntError> { use self::IntErrorKind::*; use self::ParseIntError as PIE; |
