mirror of
https://github.com/uutils/coreutils
synced 2024-10-07 16:39:26 +00:00
Remove trivially unnessessary unwrap() from od
This commit is contained in:
parent
da9558c684
commit
797c4a340e
|
@ -275,17 +275,13 @@ fn parse_type_string(params: &str) -> Result<Vec<ParsedFormatterItemInfo>, Strin
|
|||
let mut chars = params.chars();
|
||||
let mut ch = chars.next();
|
||||
|
||||
while ch.is_some() {
|
||||
let type_char = ch.unwrap();
|
||||
let type_char = match format_type(type_char) {
|
||||
Some(t) => t,
|
||||
None => {
|
||||
return Err(format!(
|
||||
"unexpected char '{}' in format specification '{}'",
|
||||
type_char, params
|
||||
));
|
||||
}
|
||||
};
|
||||
while let Some(type_char) = ch {
|
||||
let type_char = format_type(type_char).ok_or_else(|| {
|
||||
format!(
|
||||
"unexpected char '{}' in format specification '{}'",
|
||||
type_char, params
|
||||
)
|
||||
})?;
|
||||
|
||||
let type_cat = format_type_category(type_char);
|
||||
|
||||
|
|
Loading…
Reference in a new issue