From a65a52c18e5d8698aee208f17f2c61727d3e4122 Mon Sep 17 00:00:00 2001 From: lli Date: Thu, 25 Jul 2024 14:50:15 -0700 Subject: [PATCH] Minor Clippy/Test fixes Signed-off-by: lli --- aries/agents/aath-backchannel/src/controllers/did_exchange.rs | 2 +- aries/agents/aath-backchannel/src/controllers/issuance.rs | 1 + aries/agents/aries-vcx-agent/src/handlers/did_exchange.rs | 2 +- aries/aries_vcx/src/protocols/did_exchange/mod.rs | 4 ++-- aries/aries_vcx/tests/test_did_exchange.rs | 4 ++-- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/aries/agents/aath-backchannel/src/controllers/did_exchange.rs b/aries/agents/aath-backchannel/src/controllers/did_exchange.rs index a876bb9cf2..4e884bffec 100644 --- a/aries/agents/aath-backchannel/src/controllers/did_exchange.rs +++ b/aries/agents/aath-backchannel/src/controllers/did_exchange.rs @@ -202,7 +202,7 @@ impl HarnessAgent { let (thid, pthid, my_did, their_did) = self .aries_agent .did_exchange() - .handle_msg_request(request, &inviter_key, opt_invitation) + .handle_msg_request(request, &inviter_key.clone(), opt_invitation) .await?; if let Some(pthid) = pthid { diff --git a/aries/agents/aath-backchannel/src/controllers/issuance.rs b/aries/agents/aath-backchannel/src/controllers/issuance.rs index 34a27d5a03..79c3d7528d 100644 --- a/aries/agents/aath-backchannel/src/controllers/issuance.rs +++ b/aries/agents/aath-backchannel/src/controllers/issuance.rs @@ -95,6 +95,7 @@ async fn download_tails_file( let url = match tails_base_url.to_string().matches('/').count() { 0 => format!("{}/{}", tails_base_url, rev_reg_id), 1.. => tails_base_url.to_string(), + _ => todo!(), }; let client = reqwest::Client::new(); let tails_folder_path = std::env::current_dir() diff --git a/aries/agents/aries-vcx-agent/src/handlers/did_exchange.rs b/aries/agents/aries-vcx-agent/src/handlers/did_exchange.rs index 3214014caf..7e00162999 100644 --- a/aries/agents/aries-vcx-agent/src/handlers/did_exchange.rs +++ b/aries/agents/aries-vcx-agent/src/handlers/did_exchange.rs @@ -125,7 +125,7 @@ impl DidcommHandlerDidExchange { pub async fn handle_msg_request( &self, request: AnyRequest, - request_did: &String, + request_did: &str, invitation: Option, ) -> AgentResult<(String, Option, String, String)> { // todo: type the return type diff --git a/aries/aries_vcx/src/protocols/did_exchange/mod.rs b/aries/aries_vcx/src/protocols/did_exchange/mod.rs index ca388bfc89..fe17e135e4 100644 --- a/aries/aries_vcx/src/protocols/did_exchange/mod.rs +++ b/aries/aries_vcx/src/protocols/did_exchange/mod.rs @@ -116,11 +116,11 @@ pub async fn resolve_enc_key_from_invitation( } pub async fn resolve_enc_key_from_did( - did: &String, + did: &str, resolver_registry: &Arc, ) -> Result { let output = resolver_registry - .resolve(&did.clone().try_into()?, &Default::default()) + .resolve(&did.try_into()?, &Default::default()) .await .map_err(|err| { AriesVcxError::from_msg( diff --git a/aries/aries_vcx/tests/test_did_exchange.rs b/aries/aries_vcx/tests/test_did_exchange.rs index bb3f34c8a9..a7f7f6cf58 100644 --- a/aries/aries_vcx/tests/test_did_exchange.rs +++ b/aries/aries_vcx/tests/test_did_exchange.rs @@ -135,7 +135,7 @@ async fn did_exchange_test( &resolver_registry, request, &responders_peer_did, - Some(invitation_key.clone()), + invitation_key.clone(), ) .await .unwrap(); @@ -337,7 +337,7 @@ async fn did_exchange_test_with_invalid_rotation_signature() -> Result<(), Box