diff options
| author | Richo Healey <richo@psych0tik.net> | 2014-06-21 03:39:03 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2014-07-08 13:01:43 -0700 |
| commit | 12c334a77b897f7b1cb6cff3c56a71ecb89c82af (patch) | |
| tree | 1f5a85061a69058875391ec6171cf8b446996dff /src/libnum | |
| parent | bfe4ddfdea45533c98657701509bb7185fd96cba (diff) | |
| download | rust-12c334a77b897f7b1cb6cff3c56a71ecb89c82af.tar.gz rust-12c334a77b897f7b1cb6cff3c56a71ecb89c82af.zip | |
std: Rename the `ToStr` trait to `ToString`, and `to_str` to `to_string`.
[breaking-change]
Diffstat (limited to 'src/libnum')
| -rw-r--r-- | src/libnum/bigint.rs | 8 | ||||
| -rw-r--r-- | src/libnum/complex.rs | 4 | ||||
| -rw-r--r-- | src/libnum/rational.rs | 3 |
3 files changed, 8 insertions, 7 deletions
diff --git a/src/libnum/bigint.rs b/src/libnum/bigint.rs index cc3753def59..046ba96f45a 100644 --- a/src/libnum/bigint.rs +++ b/src/libnum/bigint.rs @@ -2737,7 +2737,7 @@ mod bigint_tests { // attempt to allocate a vector of size (-1u) == huge. let x: BigInt = from_str(format!("1{}", "0".repeat(36)).as_slice()).unwrap(); - let _y = x.to_str(); + let _y = x.to_string(); } #[test] @@ -2842,14 +2842,14 @@ mod bench { } #[bench] - fn to_str(b: &mut Bencher) { + fn to_string(b: &mut Bencher) { let fac = factorial(100); let fib = fib(100); b.iter(|| { - fac.to_str(); + fac.to_string(); }); b.iter(|| { - fib.to_str(); + fib.to_string(); }); } diff --git a/src/libnum/complex.rs b/src/libnum/complex.rs index 9ee80d283cf..f4a3ac97a4e 100644 --- a/src/libnum/complex.rs +++ b/src/libnum/complex.rs @@ -347,9 +347,9 @@ mod test { } #[test] - fn test_to_str() { + fn test_to_string() { fn test(c : Complex64, s: String) { - assert_eq!(c.to_str(), s); + assert_eq!(c.to_string(), s); } test(_0_0i, "0+0i".to_string()); test(_1_0i, "1+0i".to_string()); diff --git a/src/libnum/rational.rs b/src/libnum/rational.rs index 1792f282eca..a279ede6fa5 100644 --- a/src/libnum/rational.rs +++ b/src/libnum/rational.rs @@ -17,6 +17,7 @@ use std::fmt; use std::from_str::FromStr; use std::num; use std::num::{Zero, One, ToStrRadix, FromStrRadix}; + use bigint::{BigInt, BigUint, Sign, Plus, Minus}; /// Represents the ratio between 2 numbers. @@ -603,7 +604,7 @@ mod test { fn test_to_from_str() { fn test(r: Rational, s: String) { assert_eq!(FromStr::from_str(s.as_slice()), Some(r)); - assert_eq!(r.to_str(), s); + assert_eq!(r.to_string(), s); } test(_1, "1".to_string()); test(_0, "0".to_string()); |
