From cea05e9f22b40edf2ccd2a0676827974796972a2 Mon Sep 17 00:00:00 2001 From: Taylor Date: Wed, 10 Oct 2018 22:19:40 -0600 Subject: [PATCH] be consistent --- src/clap_app.rs | 4 ++-- src/printer.rs | 14 ++++---------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/clap_app.rs b/src/clap_app.rs index 11d79b51..36a4b60f 100644 --- a/src/clap_app.rs +++ b/src/clap_app.rs @@ -146,10 +146,10 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> { .long("highlight-line") .overrides_with("highlight-line") .takes_value(true) - .value_name("n") + .value_name("N") .help("Highlight a line.") .long_help( - "Highlight the nth line. The background color is changed to create contrast.", + "Highlight the Nth line. The background color is changed to create contrast.", ), ) .arg( diff --git a/src/printer.rs b/src/printer.rs index 68b2a998..dd4abdd9 100644 --- a/src/printer.rs +++ b/src/printer.rs @@ -302,16 +302,10 @@ impl<'a> Printer for InteractivePrinter<'a> { } // Line highlighting - let background = match self.config.highlight_line { - Some(line) => { - if line_number == line { - self.background_highlight - } else { - None - } - } - _ => None, - }; + let background = self.config.highlight_line + .filter(|line| *line == line_number) + .map(|_| self.background_highlight) + .unwrap(); // Line contents. if self.config.output_wrap == OutputWrap::None {