diff options
| author | bors <bors@rust-lang.org> | 2014-05-22 15:16:31 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-05-22 15:16:31 -0700 |
| commit | 87ad19eb78239707f1ceed43e475c6aa052efdbc (patch) | |
| tree | 35940d52f145bca81dcf73e5e7da7f3847ceb413 /src/libnum/complex.rs | |
| parent | e402e75f4eb79af09b9451f0f232f994b3e2c998 (diff) | |
| parent | e878721d70349e2055f0ef854085de92e9498fde (diff) | |
| download | rust-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.rs | 10 |
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)) } } } |
