Skip to content

Commit

Permalink
style: remove unnecessary let binding
Browse files Browse the repository at this point in the history
  • Loading branch information
nanderstabel committed Apr 19, 2024
1 parent f190ada commit f1c5c6e
Showing 1 changed file with 17 additions and 20 deletions.
37 changes: 17 additions & 20 deletions agent_api_rest/src/issuance/offers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,28 +108,25 @@ pub mod tests {
let body = axum::body::to_bytes(response.into_body(), usize::MAX).await.unwrap();
let body: String = String::from_utf8(body.to_vec()).unwrap();

let pre_authorized_code =
if let CredentialOffer::CredentialOffer(credential_offer) = CredentialOffer::from_str(&body).unwrap() {
let CredentialOfferParameters {
grants:
Some(Grants {
pre_authorized_code:
Some(PreAuthorizedCode {
pre_authorized_code, ..
}),
..
}),
..
} = *credential_offer
else {
unreachable!()
};
pre_authorized_code
} else {
if let CredentialOffer::CredentialOffer(credential_offer) = CredentialOffer::from_str(&body).unwrap() {
let CredentialOfferParameters {
grants:
Some(Grants {
pre_authorized_code:
Some(PreAuthorizedCode {
pre_authorized_code, ..
}),
..
}),
..
} = *credential_offer
else {
unreachable!()
};

pre_authorized_code
pre_authorized_code
} else {
unreachable!()
}
}

#[tokio::test]
Expand Down

0 comments on commit f1c5c6e

Please sign in to comment.