1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-09-12 08:12:27 +01:00

Applied linter fixes

This commit is contained in:
Daniele Esposti
2019-03-08 10:46:49 +00:00
committed by David Peter
parent a21ae614e6
commit 82f14121bd
12 changed files with 37 additions and 44 deletions

View File

@@ -64,7 +64,7 @@ impl Printer for SimplePrinter {
line_buffer: &[u8],
) -> Result<()> {
if !out_of_range {
handle.write(line_buffer)?;
handle.write_all(line_buffer)?;
}
Ok(())
}
@@ -270,7 +270,7 @@ impl<'a> Printer for InteractivePrinter<'a> {
};
if self.config.show_nonprintable {
line = replace_nonprintable(&mut line, self.config.tab_width);
line = replace_nonprintable(&line, self.config.tab_width);
}
let regions = {
@@ -355,11 +355,11 @@ impl<'a> Printer for InteractivePrinter<'a> {
}
if line.bytes().next_back() != Some(b'\n') {
write!(handle, "\n")?;
writeln!(handle)?;
}
} else {
for &(style, region) in regions.iter() {
let mut ansi_iterator = AnsiCodeIterator::new(region);
let ansi_iterator = AnsiCodeIterator::new(region);
let mut ansi_prefix: String = String::new();
for chunk in ansi_iterator {
match chunk {
@@ -472,7 +472,7 @@ impl<'a> Printer for InteractivePrinter<'a> {
ansi_style.paint(" ".repeat(cursor_max - cursor))
)?;
}
write!(handle, "\n")?;
writeln!(handle)?;
}
Ok(())