mirror of
https://github.com/uutils/coreutils
synced 2024-12-14 23:32:39 +00:00
wc: change where to unwrap
This commit is contained in:
parent
f8f6346126
commit
16f6a13697
1 changed files with 5 additions and 3 deletions
|
@ -167,7 +167,9 @@ impl<'a> Inputs<'a> {
|
|||
None => Ok(Self::Files0From(input)),
|
||||
}
|
||||
}
|
||||
(Some(mut files), Some(_)) => Err(WcError::files_disabled(files.next()).into()),
|
||||
(Some(mut files), Some(_)) => {
|
||||
Err(WcError::files_disabled(files.next().unwrap()).into())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -365,8 +367,8 @@ impl WcError {
|
|||
None => Self::ZeroLengthFileName,
|
||||
}
|
||||
}
|
||||
fn files_disabled(first_extra: Option<&OsString>) -> Self {
|
||||
let extra = first_extra.unwrap().to_string_lossy().into_owned().into();
|
||||
fn files_disabled(first_extra: &OsString) -> Self {
|
||||
let extra = first_extra.to_string_lossy().into_owned().into();
|
||||
Self::FilesDisabled { extra }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue