diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2015-02-17 09:47:49 -0500 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2015-02-18 09:09:12 -0500 |
| commit | 2b5720a15fd7e8ae3883dcaee556b000e962b052 (patch) | |
| tree | 967aa12a6089aca54098adf56e97abff223b8798 /src/libstd/num | |
| parent | 700c518f2afd4b759fb54b867aee62660188d870 (diff) | |
| download | rust-2b5720a15fd7e8ae3883dcaee556b000e962b052.tar.gz rust-2b5720a15fd7e8ae3883dcaee556b000e962b052.zip | |
Remove `i`, `is`, `u`, or `us` suffixes that are not necessary.
Diffstat (limited to 'src/libstd/num')
| -rw-r--r-- | src/libstd/num/mod.rs | 6 | ||||
| -rw-r--r-- | src/libstd/num/strconv.rs | 6 | ||||
| -rw-r--r-- | src/libstd/num/uint_macros.rs | 20 |
3 files changed, 16 insertions, 16 deletions
diff --git a/src/libstd/num/mod.rs b/src/libstd/num/mod.rs index 4582dcd2b03..a1780652c81 100644 --- a/src/libstd/num/mod.rs +++ b/src/libstd/num/mod.rs @@ -1149,7 +1149,7 @@ mod tests { assert_eq!(_20, NumCast::from(20f32).unwrap()); assert_eq!(_20, NumCast::from(20f64).unwrap()); - assert_eq!(_20, cast(20u).unwrap()); + assert_eq!(_20, cast(20usize).unwrap()); assert_eq!(_20, cast(20u8).unwrap()); assert_eq!(_20, cast(20u16).unwrap()); assert_eq!(_20, cast(20u32).unwrap()); @@ -1763,7 +1763,7 @@ mod bench { #[bench] fn bench_pow_function(b: &mut Bencher) { - let v = (0..1024u).collect::<Vec<_>>(); - b.iter(|| {v.iter().fold(0u, |old, new| old.pow(*new));}); + let v = (0..1024).collect::<Vec<_>>(); + b.iter(|| {v.iter().fold(0, |old, new| old.pow(*new));}); } } diff --git a/src/libstd/num/strconv.rs b/src/libstd/num/strconv.rs index cf5e1eb0eb7..f6d05f961e1 100644 --- a/src/libstd/num/strconv.rs +++ b/src/libstd/num/strconv.rs @@ -262,7 +262,7 @@ pub fn float_to_str_bytes_common<T: Float>( // If limited digits, calculate one digit more for rounding. let (limit_digits, digit_count, exact) = match digits { - DigAll => (false, 0u, false), + DigAll => (false, 0, false), DigMax(count) => (true, count+1, false), DigExact(count) => (true, count+1, true) }; @@ -289,7 +289,7 @@ pub fn float_to_str_bytes_common<T: Float>( deccum = num.fract(); if deccum != _0 || (limit_digits && exact && digit_count > 0) { buf.push(b'.'); - let mut dig = 0u; + let mut dig = 0; // calculate new digits while // - there is no limit and there are digits left @@ -314,7 +314,7 @@ pub fn float_to_str_bytes_common<T: Float>( // Decrease the deccumulator one fractional digit at a time deccum = deccum.fract(); - dig += 1u; + dig += 1; } // If digits are limited, and that limit has been reached, diff --git a/src/libstd/num/uint_macros.rs b/src/libstd/num/uint_macros.rs index 4cd6391318f..8d4f0344beb 100644 --- a/src/libstd/num/uint_macros.rs +++ b/src/libstd/num/uint_macros.rs @@ -25,11 +25,11 @@ mod tests { #[test] pub fn test_from_str() { - assert_eq!(from_str::<$T>("0"), Some(0u as $T)); - assert_eq!(from_str::<$T>("3"), Some(3u as $T)); - assert_eq!(from_str::<$T>("10"), Some(10u as $T)); + assert_eq!(from_str::<$T>("0"), Some(0 as $T)); + assert_eq!(from_str::<$T>("3"), Some(3 as $T)); + assert_eq!(from_str::<$T>("10"), Some(10 as $T)); assert_eq!(from_str::<u32>("123456789"), Some(123456789 as u32)); - assert_eq!(from_str::<$T>("00100"), Some(100u as $T)); + assert_eq!(from_str::<$T>("00100"), Some(100 as $T)); assert_eq!(from_str::<$T>(""), None); assert_eq!(from_str::<$T>(" "), None); @@ -38,12 +38,12 @@ mod tests { #[test] pub fn test_parse_bytes() { - assert_eq!(FromStrRadix::from_str_radix("123", 10), Ok(123u as $T)); - assert_eq!(FromStrRadix::from_str_radix("1001", 2), Ok(9u as $T)); - assert_eq!(FromStrRadix::from_str_radix("123", 8), Ok(83u as $T)); - assert_eq!(FromStrRadix::from_str_radix("123", 16), Ok(291u as u16)); - assert_eq!(FromStrRadix::from_str_radix("ffff", 16), Ok(65535u as u16)); - assert_eq!(FromStrRadix::from_str_radix("z", 36), Ok(35u as $T)); + assert_eq!(FromStrRadix::from_str_radix("123", 10), Ok(123 as $T)); + assert_eq!(FromStrRadix::from_str_radix("1001", 2), Ok(9 as $T)); + assert_eq!(FromStrRadix::from_str_radix("123", 8), Ok(83 as $T)); + assert_eq!(FromStrRadix::from_str_radix("123", 16), Ok(291 as u16)); + assert_eq!(FromStrRadix::from_str_radix("ffff", 16), Ok(65535 as u16)); + assert_eq!(FromStrRadix::from_str_radix("z", 36), Ok(35 as $T)); assert_eq!(FromStrRadix::from_str_radix("Z", 10).ok(), None::<$T>); assert_eq!(FromStrRadix::from_str_radix("_", 2).ok(), None::<$T>); |
