Skip to content

Commit

Permalink
Fix clippy warning
Browse files Browse the repository at this point in the history
  • Loading branch information
sosthene-nitrokey committed Apr 10, 2024
1 parent b7e6e51 commit 8d5d948
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/core_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ fn handle_rsa_import_format(data: &[u8], size: u16) -> Option<RsaImportElements>
CtOption::new(d, success.into())
});

let Some((d, n)) = d_opt
let maybe_d_n: Option<_> = d_opt
.and_then(|d| {
let n: CtOption<_> = n_opt.into();
n.and_then(|n| {
Expand All @@ -154,10 +154,9 @@ fn handle_rsa_import_format(data: &[u8], size: u16) -> Option<RsaImportElements>
CtOption::new(value, choice)
})
})
.into()
else {
return None;
};
.into();

let (d, n) = maybe_d_n?;

Some(RsaImportElements { e: parsed.e, d, n })
}
Expand Down

0 comments on commit 8d5d948

Please sign in to comment.