diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-05-27 20:44:58 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-05-28 08:35:41 -0700 |
| commit | 42aed6bde2fb05a262e21334656cdf91f51744dd (patch) | |
| tree | 0b7c43f70001fe714a13f95df7e2807a8fdfb85b /src/libnum | |
| parent | 24b1ce1daf9dbf66d04116d0549a48a7610bc614 (diff) | |
| download | rust-42aed6bde2fb05a262e21334656cdf91f51744dd.tar.gz rust-42aed6bde2fb05a262e21334656cdf91f51744dd.zip | |
std: Remove format_strbuf!()
This was only ever a transitionary macro.
Diffstat (limited to 'src/libnum')
| -rw-r--r-- | src/libnum/bigint.rs | 26 | ||||
| -rw-r--r-- | src/libnum/complex.rs | 12 | ||||
| -rw-r--r-- | src/libnum/rational.rs | 6 |
3 files changed, 22 insertions, 22 deletions
diff --git a/src/libnum/bigint.rs b/src/libnum/bigint.rs index e8d0434c392..cc35cd749d6 100644 --- a/src/libnum/bigint.rs +++ b/src/libnum/bigint.rs @@ -1215,7 +1215,7 @@ impl ToStrRadix for BigInt { match self.sign { Plus => self.data.to_str_radix(radix), Zero => "0".to_string(), - Minus => format_strbuf!("-{}", self.data.to_str_radix(radix)), + Minus => format!("-{}", self.data.to_str_radix(radix)), } } } @@ -2055,34 +2055,34 @@ mod biguint_tests { (16, "fff".to_string()) )), ( BigUint::from_slice([ 1, 2 ]), vec!( (2, - format_strbuf!("10{}1", "0".repeat(bits - 1))), + format!("10{}1", "0".repeat(bits - 1))), (4, - format_strbuf!("2{}1", "0".repeat(bits / 2 - 1))), + format!("2{}1", "0".repeat(bits / 2 - 1))), (10, match bits { 32 => "8589934593".to_string(), 16 => "131073".to_string(), _ => fail!() }), (16, - format_strbuf!("2{}1", "0".repeat(bits / 4 - 1))) + format!("2{}1", "0".repeat(bits / 4 - 1))) )), ( BigUint::from_slice([ 1, 2, 3 ]), vec!( (2, - format_strbuf!("11{}10{}1", - "0".repeat(bits - 2), - "0".repeat(bits - 1))), + format!("11{}10{}1", + "0".repeat(bits - 2), + "0".repeat(bits - 1))), (4, - format_strbuf!("3{}2{}1", - "0".repeat(bits / 2 - 1), - "0".repeat(bits / 2 - 1))), + format!("3{}2{}1", + "0".repeat(bits / 2 - 1), + "0".repeat(bits / 2 - 1))), (10, match bits { 32 => "55340232229718589441".to_string(), 16 => "12885032961".to_string(), _ => fail!() }), (16, - format_strbuf!("3{}2{}1", - "0".repeat(bits / 4 - 1), - "0".repeat(bits / 4 - 1))) + format!("3{}2{}1", + "0".repeat(bits / 4 - 1), + "0".repeat(bits / 4 - 1))) )) ) } diff --git a/src/libnum/complex.rs b/src/libnum/complex.rs index a4c21839214..6c5547b28e8 100644 --- a/src/libnum/complex.rs +++ b/src/libnum/complex.rs @@ -177,13 +177,13 @@ impl<T: fmt::Show + Num + Ord> fmt::Show for Complex<T> { impl<T: ToStrRadix + Num + Ord> ToStrRadix for Complex<T> { fn to_str_radix(&self, radix: uint) -> String { if self.im < Zero::zero() { - format_strbuf!("{}-{}i", - self.re.to_str_radix(radix), - (-self.im).to_str_radix(radix)) + format!("{}-{}i", + self.re.to_str_radix(radix), + (-self.im).to_str_radix(radix)) } else { - format_strbuf!("{}+{}i", - self.re.to_str_radix(radix), - self.im.to_str_radix(radix)) + format!("{}+{}i", + self.re.to_str_radix(radix), + self.im.to_str_radix(radix)) } } } diff --git a/src/libnum/rational.rs b/src/libnum/rational.rs index e916265396e..ba0a571268f 100644 --- a/src/libnum/rational.rs +++ b/src/libnum/rational.rs @@ -282,9 +282,9 @@ impl<T: fmt::Show> fmt::Show for Ratio<T> { impl<T: ToStrRadix> ToStrRadix for Ratio<T> { /// Renders as `numer/denom` where the numbers are in base `radix`. fn to_str_radix(&self, radix: uint) -> String { - format_strbuf!("{}/{}", - self.numer.to_str_radix(radix), - self.denom.to_str_radix(radix)) + format!("{}/{}", + self.numer.to_str_radix(radix), + self.denom.to_str_radix(radix)) } } |
