Simplify unwrapping Error
This commit is contained in:
parent
d9a25c23c9
commit
5e0ee12e17
1 changed files with 3 additions and 7 deletions
|
@ -552,13 +552,9 @@ impl CardApp {
|
||||||
) -> Result<(), OpenpgpCardError> {
|
) -> Result<(), OpenpgpCardError> {
|
||||||
let algo_list = self.list_supported_algo();
|
let algo_list = self.list_supported_algo();
|
||||||
|
|
||||||
let algo_list = if algo_list.is_ok() {
|
// An error is ok - it's fine if a card doesn't offer a list of
|
||||||
algo_list.unwrap()
|
// supported algorithms
|
||||||
} else {
|
let algo_list = algo_list.unwrap_or(None);
|
||||||
// An error is ok - it's fine if a card doesn't offer a list of
|
|
||||||
// supported algorithms
|
|
||||||
None
|
|
||||||
};
|
|
||||||
|
|
||||||
keys::upload_key(self, key, key_type, algo_list)
|
keys::upload_key(self, key, key_type, algo_list)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue