]> git.lizzy.rs Git - rust.git/blobdiff - src/checkstyle.rs
Remove BlockIndentStyle::Inherit
[rust.git] / src / checkstyle.rs
index 02e214864fad31cb52efe1a4edf28ecfa2da8027..3fc117904c718ebf3cd2bdc716e2b0bf993bf9df 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 use rustfmt_diff::{Mismatch, DiffLine};
-use std::io::{self, Write, Read};
+use std::io::{self, Write};
 use config::WriteMode;
 
 
@@ -45,18 +45,14 @@ pub fn output_checkstyle_file<T>(mut writer: T,
     try!(write!(writer, "<file name=\"{}\">", filename));
     for mismatch in diff {
         for line in mismatch.lines {
-            match line {
-                DiffLine::Expected(ref str) => {
-                    let message = xml_escape_str(&str);
-                    try!(write!(writer,
-                                "<error line=\"{}\" severity=\"warning\" message=\"Should be \
-                                 `{}`\" />",
-                                mismatch.line_number,
-                                message));
-                }
-                _ => {
-                    // Do nothing with context and expected.
-                }
+            // Do nothing with `DiffLine::Context` and `DiffLine::Resulting`.
+            if let DiffLine::Expected(ref str) = line {
+                let message = xml_escape_str(str);
+                try!(write!(writer,
+                            "<error line=\"{}\" severity=\"warning\" message=\"Should be `{}`\" \
+                             />",
+                            mismatch.line_number,
+                            message));
             }
         }
     }