diff options
Diffstat (limited to 'src/libstd/num/uint_macros.rs')
| -rw-r--r-- | src/libstd/num/uint_macros.rs | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/src/libstd/num/uint_macros.rs b/src/libstd/num/uint_macros.rs index a033308af16..f9bc9eb539a 100644 --- a/src/libstd/num/uint_macros.rs +++ b/src/libstd/num/uint_macros.rs @@ -82,36 +82,15 @@ pub fn to_str_bytes<U>(n: $T, radix: uint, f: |v: &[u8]| -> U) -> U { f(buf[..amt]) } -#[deprecated = "use fmt::radix"] -impl ToStrRadix for $T { - /// Convert to a string in a given base. - #[inline] - fn to_str_radix(&self, radix: uint) -> String { - format!("{}", ::fmt::radix(*self, radix as u8)) - } -} - #[cfg(test)] mod tests { use prelude::*; use super::*; - use num::ToStrRadix; use str::StrSlice; use u16; #[test] - pub fn test_to_string() { - assert_eq!((0 as $T).to_str_radix(10u), "0".to_string()); - assert_eq!((1 as $T).to_str_radix(10u), "1".to_string()); - assert_eq!((2 as $T).to_str_radix(10u), "2".to_string()); - assert_eq!((11 as $T).to_str_radix(10u), "11".to_string()); - assert_eq!((11 as $T).to_str_radix(16u), "b".to_string()); - assert_eq!((255 as $T).to_str_radix(16u), "ff".to_string()); - assert_eq!((0xff as $T).to_str_radix(10u), "255".to_string()); - } - - #[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)); @@ -199,18 +178,6 @@ mod tests { assert_eq!(from_str::<u64>("0"), Some(u64_val)); assert!(from_str::<u64>("-1").is_none()); } - - #[test] - #[should_fail] - pub fn to_str_radix1() { - 100u.to_str_radix(1u); - } - - #[test] - #[should_fail] - pub fn to_str_radix37() { - 100u.to_str_radix(37u); - } } )) |
