about summary refs log tree commit diff
path: root/src/libregex
diff options
context:
space:
mode:
Diffstat (limited to 'src/libregex')
-rw-r--r--src/libregex/parse.rs3
-rw-r--r--src/libregex/re.rs4
2 files changed, 4 insertions, 3 deletions
diff --git a/src/libregex/parse.rs b/src/libregex/parse.rs
index 1cc2b271e9c..7331bc36d79 100644
--- a/src/libregex/parse.rs
+++ b/src/libregex/parse.rs
@@ -30,6 +30,7 @@ static MAX_REPEAT: uint = 1000;
 ///
 /// (Once an expression is compiled, it is not possible to produce an error
 /// via searching, splitting or replacing.)
+#[derive(Show)]
 pub struct Error {
     /// The *approximate* character index of where the error occurred.
     pub pos: uint,
@@ -37,7 +38,7 @@ pub struct Error {
     pub msg: String,
 }
 
-impl fmt::Show for Error {
+impl fmt::Display for Error {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         write!(f, "Regex syntax error near position {}: {:?}",
                self.pos, self.msg)
diff --git a/src/libregex/re.rs b/src/libregex/re.rs
index abc51d62404..a740e2043b9 100644
--- a/src/libregex/re.rs
+++ b/src/libregex/re.rs
@@ -90,10 +90,10 @@ impl Clone for ExNative {
     }
 }
 
-impl fmt::String for Regex {
+impl fmt::Display for Regex {
     /// Shows the original regular expression.
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        fmt::String::fmt(self.as_str(), f)
+        fmt::Display::fmt(self.as_str(), f)
     }
 }