mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2026-01-15 09:41:07 +00:00
base32: clean up returning Err
This commit is contained in:
parent
f104f8868c
commit
c5594bc9bc
1 changed files with 7 additions and 9 deletions
|
|
@ -54,15 +54,13 @@ impl Config {
|
|||
None => None,
|
||||
};
|
||||
|
||||
let cols = match options.value_of(options::WRAP) {
|
||||
Some(num) => match num.parse::<usize>() {
|
||||
Ok(n) => Some(n),
|
||||
Err(e) => {
|
||||
return Err(format!("Invalid wrap size: ‘{}’: {}", num, e));
|
||||
}
|
||||
},
|
||||
None => None,
|
||||
};
|
||||
let cols = options
|
||||
.value_of(options::WRAP)
|
||||
.map(|num| {
|
||||
num.parse::<usize>()
|
||||
.map_err(|e| format!("Invalid wrap size: ‘{}’: {}", num, e))
|
||||
})
|
||||
.transpose()?;
|
||||
|
||||
Ok(Config {
|
||||
decode: options.is_present(options::DECODE),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue