mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-31 04:57:45 +00:00
stdbuf: clean up returning Err
This commit is contained in:
parent
9c56a40bcb
commit
b59c1dae59
1 changed files with 2 additions and 4 deletions
|
@ -152,10 +152,8 @@ fn check_option(matches: &ArgMatches, name: &str) -> Result<BufferType, ProgramO
|
|||
}
|
||||
}
|
||||
x => {
|
||||
let size = match parse_size(x) {
|
||||
Some(m) => m,
|
||||
None => return Err(ProgramOptionsError(format!("invalid mode {}", x))),
|
||||
};
|
||||
let size = parse_size(x)
|
||||
.ok_or_else(|| ProgramOptionsError(format!("invalid mode {}", x)))?;
|
||||
Ok(BufferType::Size(size))
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue