summaryrefslogtreecommitdiffstats
path: root/adenosine-pds/src/crypto.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2022-11-22 11:31:06 -0800
committerBryan Newbold <bnewbold@robocracy.org>2022-11-22 11:31:06 -0800
commitf1b80f13f9408db9f76410c717d67d4f9cf7ed2a (patch)
tree78e19b2422f82a8b040e68e50758f4f6299a67fb /adenosine-pds/src/crypto.rs
parent4fd86c1b2191aaaabc2b8a6ec5fc1078d75a28b5 (diff)
downloadadenosine-f1b80f13f9408db9f76410c717d67d4f9cf7ed2a.tar.gz
adenosine-f1b80f13f9408db9f76410c717d67d4f9cf7ed2a.zip
clippy cleanups
Diffstat (limited to 'adenosine-pds/src/crypto.rs')
-rw-r--r--adenosine-pds/src/crypto.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/adenosine-pds/src/crypto.rs b/adenosine-pds/src/crypto.rs
index d1a864e..e10401a 100644
--- a/adenosine-pds/src/crypto.rs
+++ b/adenosine-pds/src/crypto.rs
@@ -76,16 +76,14 @@ impl KeyPair {
}
pub fn from_hex(hex: &str) -> Result<Self> {
- Ok(Self::from_bytes(
- &data_encoding::HEXUPPER.decode(hex.as_bytes())?,
- )?)
+ Self::from_bytes(&data_encoding::HEXUPPER.decode(hex.as_bytes())?)
}
}
async fn build_ucan(key_material: P256KeyMaterial, did: &Did) -> Result<String> {
let token_string = UcanBuilder::default()
.issued_by(&key_material)
- .for_audience(&did.to_string())
+ .for_audience(did)
.with_nonce()
.with_lifetime(60 * 60 * 24 * 90)
.build()?
@@ -136,7 +134,7 @@ impl PubKey {
bytes.extend_from_slice(&key.to_bytes());
}
}
- format!("{}", multibase::encode(multibase::Base::Base58Btc, &bytes))
+ multibase::encode(multibase::Base::Base58Btc, &bytes)
}
/// Serializes as a 'did:key' string.