Skip to content

Commit 2f370ec

Browse files
committed
cli_args.rs: don't rewrap unnecessarily line numbers string
1 parent b7c8860 commit 2f370ec

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/cli_args.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ fn ignore<T>(_: T) {}
234234

235235
fn parse_line_number_style<'a>(
236236
config: &mut AppConfig,
237-
value: Option<&'a str>,
237+
value: Option<&'a String>,
238238
) -> Result<(), ArgParsingError> {
239239
let style = if let Some(style) = value {
240240
style.parse::<LineNumberStyleOpt>()?.0
@@ -306,11 +306,12 @@ fn color(config: &mut AppConfig, args: &mut Peekable<impl Iterator<Item = String
306306
}
307307

308308
fn line_numbers(config: &mut AppConfig, args: &mut Peekable<impl Iterator<Item = String>>) -> bool {
309-
let spec = if let Some(spec) = args.peek() {
309+
let maybe_line_number_style = args.peek();
310+
let spec = if let Some(spec) = maybe_line_number_style {
310311
if spec.starts_with("--") { // next option
311312
parse_line_number_style(config, None)
312313
} else {
313-
let parse_result = parse_line_number_style(config, Some(&*spec));
314+
let parse_result = parse_line_number_style(config, maybe_line_number_style);
314315
args.next();
315316
parse_result
316317
}

0 commit comments

Comments
 (0)