Fix formatting errors.
This commit is contained in:
parent
d188854e13
commit
309f284dfb
1 changed files with 11 additions and 12 deletions
|
@ -43,8 +43,7 @@ pub fn write_all_files(file_map: &FileMap,
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn output_heading(file_map: &FileMap,
|
pub fn output_heading(file_map: &FileMap, mode: WriteMode) -> Result<(), io::Error> {
|
||||||
mode: WriteMode) -> Result<(), io::Error> {
|
|
||||||
let stdout = stdout();
|
let stdout = stdout();
|
||||||
let mut stdout = stdout.lock();
|
let mut stdout = stdout.lock();
|
||||||
match mode {
|
match mode {
|
||||||
|
@ -56,14 +55,11 @@ pub fn output_heading(file_map: &FileMap,
|
||||||
try!(write!(stdout, "{}", xml_heading));
|
try!(write!(stdout, "{}", xml_heading));
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
_ => {
|
_ => Ok(()),
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn output_trailing(file_map: &FileMap,
|
pub fn output_trailing(file_map: &FileMap, mode: WriteMode) -> Result<(), io::Error> {
|
||||||
mode: WriteMode) -> Result<(), io::Error> {
|
|
||||||
let stdout = stdout();
|
let stdout = stdout();
|
||||||
let mut stdout = stdout.lock();
|
let mut stdout = stdout.lock();
|
||||||
match mode {
|
match mode {
|
||||||
|
@ -73,15 +69,14 @@ pub fn output_trailing(file_map: &FileMap,
|
||||||
try!(write!(stdout, "{}", xml_tail));
|
try!(write!(stdout, "{}", xml_tail));
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
_ => {
|
_ => Ok(()),
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn output_checkstyle_file<T>(mut writer: T,
|
pub fn output_checkstyle_file<T>(mut writer: T,
|
||||||
filename: &str,
|
filename: &str,
|
||||||
diff: Vec<Mismatch>) -> Result<(), io::Error>
|
diff: Vec<Mismatch>)
|
||||||
|
-> Result<(), io::Error>
|
||||||
where T: Write
|
where T: Write
|
||||||
{
|
{
|
||||||
try!(write!(writer, "<file name=\"{}\">", filename));
|
try!(write!(writer, "<file name=\"{}\">", filename));
|
||||||
|
@ -89,7 +84,11 @@ pub fn output_checkstyle_file<T>(mut writer: T,
|
||||||
for line in mismatch.lines {
|
for line in mismatch.lines {
|
||||||
match line {
|
match line {
|
||||||
DiffLine::Expected(ref str) => {
|
DiffLine::Expected(ref str) => {
|
||||||
try!(write!(writer, "<error line=\"{}\" severity=\"error\" message=\"Should be `{}`\" />", mismatch.line_number, str));
|
try!(write!(writer,
|
||||||
|
"<error line=\"{}\" severity=\"error\" message=\"Should be \
|
||||||
|
`{}`\" />",
|
||||||
|
mismatch.line_number,
|
||||||
|
str));
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
// Do nothing with context and expected.
|
// Do nothing with context and expected.
|
||||||
|
|
Loading…
Reference in a new issue