diff options
| author | Richo Healey <richo@psych0tik.net> | 2014-05-25 03:17:19 -0700 |
|---|---|---|
| committer | Richo Healey <richo@psych0tik.net> | 2014-05-27 12:59:31 -0700 |
| commit | 1f1b2e42d76ba1cd884adc49922636a6c2ac1b2f (patch) | |
| tree | 2a56d5ceda84c1a58796fe0fc4e7cea38a9336f6 /src/libstd/num | |
| parent | 4348e23b269739657d934b532ad061bfd6d92309 (diff) | |
| download | rust-1f1b2e42d76ba1cd884adc49922636a6c2ac1b2f.tar.gz rust-1f1b2e42d76ba1cd884adc49922636a6c2ac1b2f.zip | |
std: Rename strbuf operations to string
[breaking-change]
Diffstat (limited to 'src/libstd/num')
| -rw-r--r-- | src/libstd/num/int_macros.rs | 26 | ||||
| -rw-r--r-- | src/libstd/num/uint_macros.rs | 30 |
2 files changed, 28 insertions, 28 deletions
diff --git a/src/libstd/num/int_macros.rs b/src/libstd/num/int_macros.rs index 4456c8124ba..7ed00e3dd9d 100644 --- a/src/libstd/num/int_macros.rs +++ b/src/libstd/num/int_macros.rs @@ -136,39 +136,39 @@ mod tests { #[test] fn test_to_str() { - assert_eq!((0 as $T).to_str_radix(10u), "0".to_strbuf()); - assert_eq!((1 as $T).to_str_radix(10u), "1".to_strbuf()); - assert_eq!((-1 as $T).to_str_radix(10u), "-1".to_strbuf()); - assert_eq!((127 as $T).to_str_radix(16u), "7f".to_strbuf()); - assert_eq!((100 as $T).to_str_radix(10u), "100".to_strbuf()); + 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!((-1 as $T).to_str_radix(10u), "-1".to_string()); + assert_eq!((127 as $T).to_str_radix(16u), "7f".to_string()); + assert_eq!((100 as $T).to_str_radix(10u), "100".to_string()); } #[test] fn test_int_to_str_overflow() { let mut i8_val: i8 = 127_i8; - assert_eq!(i8_val.to_str(), "127".to_strbuf()); + assert_eq!(i8_val.to_str(), "127".to_string()); i8_val += 1 as i8; - assert_eq!(i8_val.to_str(), "-128".to_strbuf()); + assert_eq!(i8_val.to_str(), "-128".to_string()); let mut i16_val: i16 = 32_767_i16; - assert_eq!(i16_val.to_str(), "32767".to_strbuf()); + assert_eq!(i16_val.to_str(), "32767".to_string()); i16_val += 1 as i16; - assert_eq!(i16_val.to_str(), "-32768".to_strbuf()); + assert_eq!(i16_val.to_str(), "-32768".to_string()); let mut i32_val: i32 = 2_147_483_647_i32; - assert_eq!(i32_val.to_str(), "2147483647".to_strbuf()); + assert_eq!(i32_val.to_str(), "2147483647".to_string()); i32_val += 1 as i32; - assert_eq!(i32_val.to_str(), "-2147483648".to_strbuf()); + assert_eq!(i32_val.to_str(), "-2147483648".to_string()); let mut i64_val: i64 = 9_223_372_036_854_775_807_i64; - assert_eq!(i64_val.to_str(), "9223372036854775807".to_strbuf()); + assert_eq!(i64_val.to_str(), "9223372036854775807".to_string()); i64_val += 1 as i64; - assert_eq!(i64_val.to_str(), "-9223372036854775808".to_strbuf()); + assert_eq!(i64_val.to_str(), "-9223372036854775808".to_string()); } #[test] diff --git a/src/libstd/num/uint_macros.rs b/src/libstd/num/uint_macros.rs index e59e638faa9..43048453717 100644 --- a/src/libstd/num/uint_macros.rs +++ b/src/libstd/num/uint_macros.rs @@ -94,13 +94,13 @@ mod tests { #[test] pub fn test_to_str() { - assert_eq!((0 as $T).to_str_radix(10u), "0".to_strbuf()); - assert_eq!((1 as $T).to_str_radix(10u), "1".to_strbuf()); - assert_eq!((2 as $T).to_str_radix(10u), "2".to_strbuf()); - assert_eq!((11 as $T).to_str_radix(10u), "11".to_strbuf()); - assert_eq!((11 as $T).to_str_radix(16u), "b".to_strbuf()); - assert_eq!((255 as $T).to_str_radix(16u), "ff".to_strbuf()); - assert_eq!((0xff as $T).to_str_radix(10u), "255".to_strbuf()); + 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] @@ -133,28 +133,28 @@ mod tests { #[test] fn test_uint_to_str_overflow() { let mut u8_val: u8 = 255_u8; - assert_eq!(u8_val.to_str(), "255".to_strbuf()); + assert_eq!(u8_val.to_str(), "255".to_string()); u8_val += 1 as u8; - assert_eq!(u8_val.to_str(), "0".to_strbuf()); + assert_eq!(u8_val.to_str(), "0".to_string()); let mut u16_val: u16 = 65_535_u16; - assert_eq!(u16_val.to_str(), "65535".to_strbuf()); + assert_eq!(u16_val.to_str(), "65535".to_string()); u16_val += 1 as u16; - assert_eq!(u16_val.to_str(), "0".to_strbuf()); + assert_eq!(u16_val.to_str(), "0".to_string()); let mut u32_val: u32 = 4_294_967_295_u32; - assert_eq!(u32_val.to_str(), "4294967295".to_strbuf()); + assert_eq!(u32_val.to_str(), "4294967295".to_string()); u32_val += 1 as u32; - assert_eq!(u32_val.to_str(), "0".to_strbuf()); + assert_eq!(u32_val.to_str(), "0".to_string()); let mut u64_val: u64 = 18_446_744_073_709_551_615_u64; - assert_eq!(u64_val.to_str(), "18446744073709551615".to_strbuf()); + assert_eq!(u64_val.to_str(), "18446744073709551615".to_string()); u64_val += 1 as u64; - assert_eq!(u64_val.to_str(), "0".to_strbuf()); + assert_eq!(u64_val.to_str(), "0".to_string()); } #[test] |
