mirror of
https://github.com/uutils/diffutils.git
synced 2026-06-10 15:48:59 -07:00
cmp.rs: simplify by .ok_or
This commit is contained in:
+1
-3
@@ -71,9 +71,7 @@ fn is_stdout_dev_null() -> bool {
|
||||
}
|
||||
|
||||
pub fn parse_params<I: Iterator<Item = OsString>>(mut opts: Peekable<I>) -> Result<Params, String> {
|
||||
let Some(executable) = opts.next() else {
|
||||
return Err("Usage: <exe> <from> <to>".to_string());
|
||||
};
|
||||
let executable = opts.next().ok_or("Usage: <exe> <from> <to>".to_string())?;
|
||||
let executable_str = executable.to_string_lossy().to_string();
|
||||
|
||||
let parse_skip = |param: &str, skip_desc: &str| -> Result<SkipU64, String> {
|
||||
|
||||
Reference in New Issue
Block a user