improvement: use or instead of unwrap_or_else for display_offset

This commit is contained in:
Erich Gubler authored and David Peter committed 2020-06-07 11:08:01 +02:00
1 parent 8af8a94699
commit 1459616d27
1 file changed
+2 -1
+2 -1
View File
@@ -142,7 +142,8 @@ fn run() -> Result<(), Box<dyn std::error::Error>> {
let display_offset = matches
.value_of("display_offset")
.and_then(|s| parse_byte_count(s, block_size))
.unwrap_or_else(|| skip_arg.unwrap_or(0));
.or(skip_arg)
.unwrap_or(0);
let stdout = io::stdout();
let mut stdout_lock = stdout.lock();