about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorRamkumar Ramachandra <artagnon@gmail.com>2013-06-06 20:47:04 +0530
committerRamkumar Ramachandra <artagnon@gmail.com>2013-06-06 20:50:29 +0530
commit01c4f11cf82f0b4cf5468f2e41d2ef9e351b7a08 (patch)
tree2d5b701b3cb33c5cd73613c0198063126bea4674 /src/libstd
parentab10b1ed292be48ac4d4cbe31da811035d284e85 (diff)
downloadrust-01c4f11cf82f0b4cf5468f2e41d2ef9e351b7a08.tar.gz
rust-01c4f11cf82f0b4cf5468f2e41d2ef9e351b7a08.zip
libstd: use fmt! in to_str impl for (one|two)-tuple
The three-tuple uses fmt!, and there's no reason to hand-concatenate
strings.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/to_str.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/to_str.rs b/src/libstd/to_str.rs
index d15c0a31f5f..bfda92d46a2 100644
--- a/src/libstd/to_str.rs
+++ b/src/libstd/to_str.rs
@@ -44,7 +44,7 @@ impl<A:ToStr> ToStr for (A,) {
     fn to_str(&self) -> ~str {
         match *self {
             (ref a,) => {
-                ~"(" + a.to_str() + ",)"
+                fmt!("(%s,)", (*a).to_str())
             }
         }
     }
@@ -95,7 +95,7 @@ impl<A:ToStr,B:ToStr> ToStr for (A, B) {
         //let &(ref a, ref b) = self;
         match *self {
             (ref a, ref b) => {
-                ~"(" + a.to_str() + ", " + b.to_str() + ")"
+                fmt!("(%s, %s)", (*a).to_str(), (*b).to_str())
             }
         }
     }