on master help sign in
be consistent
commitcea05e9f22b40edf2ccd2a0676827974796972a2 authorTaylor <tskinn12@gmail.com> dateWed 10 Oct 2018, 22:19 (8 years ago) parent2a78515
2 files changed+6−12
src/clap_app.rs+2−2 src/printer.rs+4−10
src/clap_app.rs+2−2
@@ -146,10 +146,10 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
146146 .long("highlight-line")
147147 .overrides_with("highlight-line")
148148 .takes_value(true)
149− .value_name("n")
149+ .value_name("N")
150150 .help("Highlight a line.")
151151 .long_help(
152− "Highlight the nth line. The background color is changed to create contrast.",
152+ "Highlight the Nth line. The background color is changed to create contrast.",
153153 ),
154154 )
155155 .arg(
src/printer.rs+4−10
@@ -302,16 +302,10 @@ impl<'a> Printer for InteractivePrinter<'a> {
302302 }
303303
304304 // Line highlighting
305− let background = match self.config.highlight_line {
306− Some(line) => {
307− if line_number == line {
308− self.background_highlight
309− } else {
310− None
311− }
312− }
313− _ => None,
314− };
305+ let background = self.config.highlight_line
306+ .filter(|line| *line == line_number)
307+ .map(|_| self.background_highlight)
308+ .unwrap();
315309
316310 // Line contents.
317311 if self.config.output_wrap == OutputWrap::None {