From b1cd76906a4c7e40e3eb3569450d2dbd3be9fcab Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Sun, 15 Feb 2015 00:10:19 +0300 Subject: Fix the fallout --- src/libcore/fmt/float.rs | 10 +++++----- src/libcore/num/mod.rs | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/libcore') 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( num: T, - radix: uint, + radix: u32, negative_zero: bool, sign: SignFormat, digits: SignificantDigits, @@ -156,7 +156,7 @@ pub fn float_to_str_bytes_common( 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( // 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( 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; + fn from_str_radix(str: &str, radix: u32) -> Result; } /// A utility function that just calls FromStrRadix::from_str_radix. #[unstable(feature = "core", reason = "needs reevaluation")] -pub fn from_str_radix(str: &str, radix: uint) +pub fn from_str_radix(str: &str, radix: u32) -> Result { 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; -- cgit 1.4.1-3-g733a5