about summary refs log tree commit diff
path: root/src/libnum/complex.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-05-22 15:16:31 -0700
committerbors <bors@rust-lang.org>2014-05-22 15:16:31 -0700
commit87ad19eb78239707f1ceed43e475c6aa052efdbc (patch)
tree35940d52f145bca81dcf73e5e7da7f3847ceb413 /src/libnum/complex.rs
parente402e75f4eb79af09b9451f0f232f994b3e2c998 (diff)
parente878721d70349e2055f0ef854085de92e9498fde (diff)
downloadrust-87ad19eb78239707f1ceed43e475c6aa052efdbc.tar.gz
rust-87ad19eb78239707f1ceed43e475c6aa052efdbc.zip
auto merge of #14310 : pcwalton/rust/detildestr-alllibs, r=brson
r? @brson
Diffstat (limited to 'src/libnum/complex.rs')
-rw-r--r--src/libnum/complex.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/libnum/complex.rs b/src/libnum/complex.rs
index dfbacf6e492..37d9453fabf 100644
--- a/src/libnum/complex.rs
+++ b/src/libnum/complex.rs
@@ -175,11 +175,15 @@ 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) -> ~str {
+    fn to_str_radix(&self, radix: uint) -> StrBuf {
         if self.im < Zero::zero() {
-            format!("{}-{}i", self.re.to_str_radix(radix), (-self.im).to_str_radix(radix))
+            format_strbuf!("{}-{}i",
+                           self.re.to_str_radix(radix),
+                           (-self.im).to_str_radix(radix))
         } else {
-            format!("{}+{}i", self.re.to_str_radix(radix), self.im.to_str_radix(radix))
+            format_strbuf!("{}+{}i",
+                           self.re.to_str_radix(radix),
+                           self.im.to_str_radix(radix))
         }
     }
 }