about summary refs log tree commit diff
path: root/src/libtest
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-02-24 04:11:53 -0800
committerbors <bors@rust-lang.org>2014-02-24 04:11:53 -0800
commit672097753a217d4990129cbdfab16ef8c9b08b21 (patch)
treecf206fc1ba6465032dac4fdce670860538da0140 /src/libtest
parenta5342d5970d57dd0cc4805ba0f5385d7f3859c94 (diff)
parent8761f79485f11ef03eb6cb569ccb9f4c73e68f11 (diff)
downloadrust-672097753a217d4990129cbdfab16ef8c9b08b21.tar.gz
rust-672097753a217d4990129cbdfab16ef8c9b08b21.zip
auto merge of #12412 : alexcrichton/rust/deriving-show, r=huonw
This commit removes deriving(ToStr) in favor of deriving(Show), migrating all impls of ToStr to fmt::Show.

Most of the details can be found in the first commit message.

Closes #12477
Diffstat (limited to 'src/libtest')
-rw-r--r--src/libtest/lib.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs
index f77741ebeca..c0c62d93b39 100644
--- a/src/libtest/lib.rs
+++ b/src/libtest/lib.rs
@@ -40,14 +40,14 @@ use term::Terminal;
 use term::color::{Color, RED, YELLOW, GREEN, CYAN};
 
 use std::cmp;
-use std::io;
-use std::io::{File, PortReader, ChanWriter};
+use std::f64;
+use std::fmt;
 use std::io::stdio::StdWriter;
+use std::io::{File, PortReader, ChanWriter};
+use std::io;
+use std::os;
 use std::str;
 use std::task;
-use std::to_str::ToStr;
-use std::f64;
-use std::os;
 
 // to be used by rustc to compile tests in libtest
 pub mod test {
@@ -70,11 +70,11 @@ pub enum TestName {
     StaticTestName(&'static str),
     DynTestName(~str)
 }
-impl ToStr for TestName {
-    fn to_str(&self) -> ~str {
-        match (*self).clone() {
-            StaticTestName(s) => s.to_str(),
-            DynTestName(s) => s.to_str()
+impl fmt::Show for TestName {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match *self {
+            StaticTestName(s) => f.buf.write_str(s),
+            DynTestName(ref s) => f.buf.write_str(s.as_slice()),
         }
     }
 }