]> git.lizzy.rs Git - rust.git/blobdiff - src/libsyntax/diagnostic.rs
rollup merge of #21457: alexcrichton/issue-21436
[rust.git] / src / libsyntax / diagnostic.rs
index c17ad058ada66c8663a3a4a806a131eb68afb44f..0c7f6befc4e3e1b884c5a95df1828e5f050c559b 100644 (file)
@@ -239,9 +239,9 @@ pub enum Level {
     Help,
 }
 
-impl fmt::String for Level {
+impl fmt::Display for Level {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        use std::fmt::String;
+        use std::fmt::Display;
 
         match *self {
             Bug => "error: internal compiler error".fmt(f),
@@ -284,7 +284,7 @@ fn print_maybe_styled(w: &mut EmitterWriter,
             // to be miscolored. We assume this is rare enough that we don't
             // have to worry about it.
             if msg.ends_with("\n") {
-                try!(t.write_str(&msg[..(msg.len()-1)]));
+                try!(t.write_str(&msg[..msg.len()-1]));
                 try!(t.reset());
                 try!(t.write_str("\n"));
             } else {