summaryrefslogtreecommitdiffstats
path: root/src/printer.rs
diff options
context:
space:
mode:
authorDaniele Esposti <daniele.esposti@gmail.com>2019-03-08 10:46:49 +0000
committerDavid Peter <sharkdp@users.noreply.github.com>2019-03-09 07:43:41 +0100
commit82f14121bd70432080820c245e67c0eb3113f2c5 (patch)
treef9608346aa0ae678d5d4bb8e9a18592d7ddd3c96 /src/printer.rs
parenta21ae614e667fdea9dac64548df9985113c354dd (diff)
Applied linter fixes
Diffstat (limited to 'src/printer.rs')
-rw-r--r--src/printer.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/printer.rs b/src/printer.rs
index 6a6c92fb..692e5702 100644
--- a/src/printer.rs
+++ b/src/printer.rs
@@ -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(())