@@ -24,7 +24,7 @@ use std::env;
2424use std::fs::{self, File};
2525use std::io::{self, BufRead, BufReader, Stdout, StdoutLock, Write};
2626use std::path::Path;
27−use std::process::{self, Command, Child, Stdio};
27+use std::process::{self, Child, Command, Stdio};
2828
2929use ansi_term::Colour::{Fixed, Green, Red, White, Yellow};
3030use ansi_term::Style;
@@ -80,8 +80,7 @@ impl<'a> OutputType<'a> {
8080 .args(&["--quit-if-one-screen", "--RAW-CONTROL-CHARS", "--no-init"])
8181 .stdin(Stdio::piped())
8282 .spawn()
83− .chain_err(|| "Could not spawn pager")?
84− ))
83+ .chain_err(|| "Could not spawn pager")?))
8584 }
8685
8786 fn new_stdout(stdout: &'a Stdout) -> Self {
@@ -90,7 +89,10 @@ impl<'a> OutputType<'a> {
9089
9190 fn stdout(&mut self) -> Result<&mut Write> {
9291 Ok(match *self {
93− OutputType::Pager(ref mut command) => command.stdin.as_mut().chain_err(|| "Could not open stdin for pager")?,
92+ OutputType::Pager(ref mut command) => command
93+ .stdin
94+ .as_mut()
95+ .chain_err(|| "Could not open stdin for pager")?,
9496 OutputType::Stdout(ref mut handle) => handle,
9597 })
9698 }
@@ -179,7 +181,7 @@ fn print_file<P: AsRef<Path>>(
179181 let mut highlighter = HighlightLines::new(syntax, theme);
180182
181183 let stdout = io::stdout();
182− let mut output_type= if options.interactive_terminal {
184+ let mut output_type = if options.interactive_terminal {
183185 match OutputType::new_pager() {
184186 Ok(pager) => pager,
185187 Err(_) => OutputType::new_stdout(&stdout),
@@ -217,7 +219,6 @@ fn print_file<P: AsRef<Path>>(
217219 OptionsStyle::Plain => {}
218220 };
219221
220−
221222 for (idx, maybe_line) in reader.lines().enumerate() {
222223 let line_nr = idx + 1;
223224 let line = maybe_line.unwrap_or_else(|_| "<INVALID UTF-8>".into());
@@ -239,27 +240,29 @@ fn print_file<P: AsRef<Path>>(
239240 // Show only content for plain style
240241 OptionsStyle::Plain => writeln!(
241242 handle,
242− "{}", as_terminal_escaped(®ions, options.true_color, options.colored_output))?,
243− _ =>
244− writeln!(
245− handle,
246− "{} {} {} {}",
247− colors.line_number.paint(format!("{:4}", line_nr)),
248− // Show git modification markers only for full style
249− match options.style {
250− OptionsStyle::Full => line_change,
251− _ => Style::default().paint(" "),
252− },
253− colors.grid.paint("│"),
254− as_terminal_escaped(®ions, options.true_color, options.colored_output)
255− )?
243+ "{}",
244+ as_terminal_escaped(®ions, options.true_color, options.colored_output)
245+ )?,
246+ _ => writeln!(
247+ handle,
248+ "{} {} {} {}",
249+ colors.line_number.paint(format!("{:4}", line_nr)),
250+ // Show git modification markers only for full style
251+ match options.style {
252+ OptionsStyle::Full => line_change,
253+ _ => Style::default().paint(" "),
254+ },
255+ colors.grid.paint("│"),
256+ as_terminal_escaped(®ions, options.true_color, options.colored_output)
257+ )?,
256258 }
257259 }
258260
259261 // Show bars for all but plain style
260262 match options.style {
261− OptionsStyle::LineNumbers | OptionsStyle::Full =>
262− print_horizontal_line(handle, &colors.grid, '┴', term_width)?,
263+ OptionsStyle::LineNumbers | OptionsStyle::Full => {
264+ print_horizontal_line(handle, &colors.grid, '┴', term_width)?
265+ }
263266 OptionsStyle::Plain => {}
264267 };
265268
@@ -494,7 +497,7 @@ fn run() -> Result<()> {
494497 .takes_value(true)
495498 .possible_values(&["auto", "never", "always"])
496499 .default_value("auto")
497− .help("When to use colors")
500+ .help("When to use colors"),
498501 )
499502 .subcommand(
500503 SubCommand::with_name("init-cache")
@@ -554,7 +557,7 @@ fn main() {
554557 if let Err(error) = result {
555558 match error {
556559 Error(ErrorKind::Io(ref io_error), _)
557− if io_error.kind() == io::ErrorKind::BrokenPipe => {}
560+ if io_error.kind() == io::ErrorKind::BrokenPipe => {}
558561 _ => {
559562 eprintln!("{}: {}", Red.paint("[bat error]"), error);
560563