mirror of
https://github.com/sharkdp/hexyl.git
synced 2026-10-26 20:16:34 +00:00
improvement: use or instead of unwrap_or_else for display_offset
This commit is contained in:
1 parent
8af8a94699
commit
1459616d27
1 file changed
+2
-1
+2
-1
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user