Skip to content

Commit

Permalink
fmt with nightly
Browse files Browse the repository at this point in the history
Signed-off-by: gmulhearn <[email protected]>
  • Loading branch information
gmulhearn committed Oct 12, 2024
1 parent cd5784d commit 24dc152
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 26 deletions.
17 changes: 9 additions & 8 deletions aries/messages/src/msg_fields/protocols/cred_issuance/v1/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,16 @@ impl DelayedSerde for CredentialIssuanceV1 {
D: Deserializer<'de>,
{
let (protocol, kind_str) = msg_type;
let kind =
match protocol {
CredentialIssuanceKind::V1(CredentialIssuanceTypeV1::V1_0(kind)) => {
kind.kind_from_str(kind_str)
}
CredentialIssuanceKind::V2(_) => return Err(D::Error::custom(
let kind = match protocol {
CredentialIssuanceKind::V1(CredentialIssuanceTypeV1::V1_0(kind)) => {
kind.kind_from_str(kind_str)
}
CredentialIssuanceKind::V2(_) => {
return Err(D::Error::custom(
"Cannot deserialize issue-credential-v2 message type into issue-credential-v1",
)),
};
))
}
};

match kind.map_err(D::Error::custom)? {
CredentialIssuanceTypeV1_0::OfferCredential => {
Expand Down
17 changes: 9 additions & 8 deletions aries/messages/src/msg_fields/protocols/cred_issuance/v2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,16 @@ impl DelayedSerde for CredentialIssuanceV2 {
D: Deserializer<'de>,
{
let (protocol, kind_str) = msg_type;
let kind =
match protocol {
CredentialIssuanceKind::V2(CredentialIssuanceTypeV2::V2_0(kind)) => {
kind.kind_from_str(kind_str)
}
CredentialIssuanceKind::V1(_) => return Err(D::Error::custom(
let kind = match protocol {
CredentialIssuanceKind::V2(CredentialIssuanceTypeV2::V2_0(kind)) => {
kind.kind_from_str(kind_str)
}
CredentialIssuanceKind::V1(_) => {
return Err(D::Error::custom(
"Cannot deserialize issue-credential-v1 message type into issue-credential-v2",
)),
};
))
}
};

match kind.map_err(D::Error::custom)? {
CredentialIssuanceTypeV2_0::OfferCredential => {
Expand Down
10 changes: 6 additions & 4 deletions aries/wrappers/uniffi-aries-vcx/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ pub mod errors;
pub mod handlers;
pub mod runtime;

use aries_vcx::aries_vcx_wallet::wallet::askar::{
askar_wallet_config::AskarWalletConfig,
key_method::{ArgonLevel, AskarKdfMethod, KeyMethod},
use aries_vcx::{
aries_vcx_wallet::wallet::askar::{
askar_wallet_config::AskarWalletConfig,
key_method::{ArgonLevel, AskarKdfMethod, KeyMethod},
},
protocols::connection::pairwise_info::PairwiseInfo,
};
use aries_vcx::protocols::connection::pairwise_info::PairwiseInfo;
use handlers::{connection::*, holder::*};

use crate::{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,11 @@ mod tests {

#[test]
fn test_process_elements_with_multiple_elements() {
let did: Did = "did:peer:2.Vz6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V.\
let did: Did =
"did:peer:2.Vz6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V.\
SeyJpZCI6IiNzZXJ2aWNlLTAiLCJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9leGFtcGxlLmNvbS9lbmRwb2ludCJ9"
.parse()
.unwrap();
.parse()
.unwrap();

let did_doc = diddoc_from_peerdid2_elements(
DidDocument::new(did.clone()),
Expand All @@ -163,11 +164,12 @@ mod tests {

#[test]
fn test_process_elements_error_on_invalid_element() {
let did: Did = "did:peer:2.Vz6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V.\
let did: Did =
"did:peer:2.Vz6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V.\
SeyJpZCI6IiNzZXJ2aWNlLTAiLCJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9leGFtcGxlLmNvbS9lbmRwb2ludCJ9.\
Xinvalid"
.parse()
.unwrap();
.parse()
.unwrap();

match diddoc_from_peerdid2_elements(
DidDocument::new(did.clone()),
Expand Down

0 comments on commit 24dc152

Please sign in to comment.