1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-31 13:07:46 +00:00

Remove trivially unnessessary unwrap() from od

This commit is contained in:
Jeong YunWon 2021-06-10 13:10:16 +09:00
parent da9558c684
commit 797c4a340e

View file

@ -275,17 +275,13 @@ fn parse_type_string(params: &str) -> Result<Vec<ParsedFormatterItemInfo>, Strin
let mut chars = params.chars(); let mut chars = params.chars();
let mut ch = chars.next(); let mut ch = chars.next();
while ch.is_some() { while let Some(type_char) = ch {
let type_char = ch.unwrap(); let type_char = format_type(type_char).ok_or_else(|| {
let type_char = match format_type(type_char) { format!(
Some(t) => t, "unexpected char '{}' in format specification '{}'",
None => { type_char, params
return Err(format!( )
"unexpected char '{}' in format specification '{}'", })?;
type_char, params
));
}
};
let type_cat = format_type_category(type_char); let type_cat = format_type_category(type_char);