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:
parent
da9558c684
commit
797c4a340e
1 changed files with 7 additions and 11 deletions
|
@ -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);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue