Skip to content

Commit

Permalink
chore: fix formatting/clippy
Browse files Browse the repository at this point in the history
Signed-off-by: James Ebert <jamesebert.k@gmail.com>
  • Loading branch information
JamesKEbert committed Aug 8, 2024
1 parent 6717eb8 commit 7e3c94a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions aries/aries_vcx/src/handlers/out_of_band/receiver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ impl OutOfBandReceiver {
}

pub fn to_url(&self, domain_path: &str) -> VcxResult<Url> {
let mut oob_url = Url::parse(&domain_path.to_owned())?;
let mut oob_url = Url::parse(&domain_path)?;
let oob_query = "oob=".to_owned() + &self.to_base64_url();
oob_url.set_query(Some(&oob_query));
Ok(oob_url)
Expand All @@ -114,7 +114,7 @@ fn from_url(oob_url_string: &str) -> VcxResult<String> {
let oob_url = Url::parse(oob_url_string)?;
let (_oob_query, base64_url_encoded_oob) = oob_url
.query_pairs()
.find(|(name, _value)| name == &"oob")
.find(|(name, _value)| name == "oob")
.ok_or_else(|| {
AriesVcxError::from_msg(
AriesVcxErrorKind::InvalidInput,
Expand Down Expand Up @@ -195,7 +195,6 @@ fn attachment_to_aries_message(attach: &Attachment) -> VcxResult<Option<AriesMes

#[cfg(test)]
mod tests {
use super::*;
use messages::{
msg_fields::protocols::out_of_band::{
invitation::{Invitation, InvitationContent, InvitationDecorators, OobService},
Expand All @@ -209,6 +208,8 @@ mod tests {
};
use shared::maybe_known::MaybeKnown;

use super::*;

// Example invite formats referenced (with change to use OOB 1.1) from example invite in RFC 0434 - https://github.com/hyperledger/aries-rfcs/tree/main/features/0434-outofband
const JSON_OOB_INVITE: &str = r#"{
"@type": "https://didcomm.org/out-of-band/1.1/invitation",
Expand Down
5 changes: 3 additions & 2 deletions aries/aries_vcx/src/handlers/out_of_band/sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ impl OutOfBandSender {
}

pub fn to_url(&self, domain_path: &str) -> VcxResult<Url> {
let mut oob_url = Url::parse(&domain_path.to_owned())?;
let mut oob_url = Url::parse(&domain_path)?;
let oob_query = "oob=".to_owned() + &self.to_base64_url();
oob_url.set_query(Some(&oob_query));
Ok(oob_url)
Expand All @@ -158,7 +158,6 @@ impl Display for OutOfBandSender {

#[cfg(test)]
mod tests {
use super::*;
use messages::{
msg_fields::protocols::out_of_band::{
invitation::{Invitation, InvitationContent, InvitationDecorators, OobService},
Expand All @@ -172,6 +171,8 @@ mod tests {
};
use shared::maybe_known::MaybeKnown;

use super::*;

// Example invite formats referenced (with change to use OOB 1.1) from example invite in RFC 0434 - https://github.com/hyperledger/aries-rfcs/tree/main/features/0434-outofband
const JSON_OOB_INVITE_NO_WHITESPACE: &str = r#"{"@type":"https://didcomm.org/out-of-band/1.1/invitation","@id":"69212a3a-d068-4f9d-a2dd-4741bca89af3","label":"Faber College","goal_code":"issue-vc","goal":"To issue a Faber College Graduate credential","handshake_protocols":["https://didcomm.org/didexchange/1.0","https://didcomm.org/connections/1.0"],"services":["did:sov:LjgpST2rjsoxYegQDRm7EL"]}"#;
const OOB_BASE64_URL_ENCODED: &str = "eyJAdHlwZSI6Imh0dHBzOi8vZGlkY29tbS5vcmcvb3V0LW9mLWJhbmQvMS4xL2ludml0YXRpb24iLCJAaWQiOiI2OTIxMmEzYS1kMDY4LTRmOWQtYTJkZC00NzQxYmNhODlhZjMiLCJsYWJlbCI6IkZhYmVyIENvbGxlZ2UiLCJnb2FsX2NvZGUiOiJpc3N1ZS12YyIsImdvYWwiOiJUbyBpc3N1ZSBhIEZhYmVyIENvbGxlZ2UgR3JhZHVhdGUgY3JlZGVudGlhbCIsImhhbmRzaGFrZV9wcm90b2NvbHMiOlsiaHR0cHM6Ly9kaWRjb21tLm9yZy9kaWRleGNoYW5nZS8xLjAiLCJodHRwczovL2RpZGNvbW0ub3JnL2Nvbm5lY3Rpb25zLzEuMCJdLCJzZXJ2aWNlcyI6WyJkaWQ6c292OkxqZ3BTVDJyanNveFllZ1FEUm03RUwiXX0=";
Expand Down

0 comments on commit 7e3c94a

Please sign in to comment.