1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 03:57:44 +00:00

wc: change where to unwrap

This commit is contained in:
zhitkoff 2023-11-26 15:14:48 -05:00
parent f8f6346126
commit 16f6a13697

View file

@ -167,7 +167,9 @@ impl<'a> Inputs<'a> {
None => Ok(Self::Files0From(input)), 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, None => Self::ZeroLengthFileName,
} }
} }
fn files_disabled(first_extra: Option<&OsString>) -> Self { fn files_disabled(first_extra: &OsString) -> Self {
let extra = first_extra.unwrap().to_string_lossy().into_owned().into(); let extra = first_extra.to_string_lossy().into_owned().into();
Self::FilesDisabled { extra } Self::FilesDisabled { extra }
} }
} }