]> git.lizzy.rs Git - rust.git/commitdiff
Fix checkstyle test.
authorUtkarsh Kukreti <utkarshkukreti@gmail.com>
Fri, 17 Nov 2017 04:13:47 +0000 (09:43 +0530)
committerUtkarsh Kukreti <utkarshkukreti@gmail.com>
Fri, 17 Nov 2017 04:13:47 +0000 (09:43 +0530)
The only reason it passed before was due to a bug in the `diff` crate.
The diff was empty even though the contents of the files were different --
namely one string had a trailing newline character while the other didn't.
Now both have a trailing newline character.

src/checkstyle.rs

index 0934ed3f71920f91542a0507ecd9bad0d484d61d..34c1d81d40cda291c74cbb96326671c9ee254737 100644 (file)
@@ -33,7 +33,7 @@ pub fn output_footer<T>(out: &mut T, mode: WriteMode) -> Result<(), io::Error>
 {
     if mode == WriteMode::Checkstyle {
         let mut xml_tail = String::new();
 {
     if mode == WriteMode::Checkstyle {
         let mut xml_tail = String::new();
-        xml_tail.push_str("</checkstyle>");
+        xml_tail.push_str("</checkstyle>\n");
         write!(out, "{}", xml_tail)?;
     }
     Ok(())
         write!(out, "{}", xml_tail)?;
     }
     Ok(())