clippy: fix warnings about useless format call and remove references that would be immediately dereferenced by the compiler.

This commit is contained in:
Matthias Krüger
2017-11-19 17:26:06 +01:00
committed by Andrew Gallant
parent 4d34132365
commit 7ae1f373c2
3 changed files with 4 additions and 4 deletions

View File

@@ -397,7 +397,7 @@ impl<W: WriteColor> Printer<W> {
self.line_number(line_number, b'-');
}
if self.max_columns.map_or(false, |m| end - start > m) {
self.write(format!("[Omitted long context line]").as_bytes());
self.write(b"[Omitted long context line]");
self.write_eol();
return;
}
@@ -408,7 +408,7 @@ impl<W: WriteColor> Printer<W> {
}
fn separator(&mut self, sep: &[u8]) {
self.write(&sep);
self.write(sep);
}
fn write_path_sep(&mut self, sep: u8) {