diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2022-11-06 21:15:12 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2022-11-06 21:15:12 -0800 |
commit | ae03334a64b1d7d6506ffb60a01f5c7f941900a6 (patch) | |
tree | 87ffe21c51e2e404d798a9e257079410ac044fde /adenosine-pds/src/crypto.rs | |
parent | 8c217067ee5132c6e5453e1c09b2391880e51d83 (diff) | |
download | adenosine-ae03334a64b1d7d6506ffb60a01f5c7f941900a6.tar.gz adenosine-ae03334a64b1d7d6506ffb60a01f5c7f941900a6.zip |
pds: partial clippy clean
Diffstat (limited to 'adenosine-pds/src/crypto.rs')
-rw-r--r-- | adenosine-pds/src/crypto.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/adenosine-pds/src/crypto.rs b/adenosine-pds/src/crypto.rs index 1fa6f4c..ba69dc6 100644 --- a/adenosine-pds/src/crypto.rs +++ b/adenosine-pds/src/crypto.rs @@ -1,8 +1,5 @@ use crate::P256KeyMaterial; use anyhow::{anyhow, ensure, Result}; -use k256; -use multibase; -use p256; use p256::ecdsa::signature::{Signer, Verifier}; use std::str::FromStr; use ucan::builder::UcanBuilder; @@ -52,7 +49,7 @@ impl KeyPair { } pub fn pubkey(&self) -> PubKey { - PubKey::P256(self.public.clone()) + PubKey::P256(self.public) } pub fn sign_bytes(&self, data: &[u8]) -> String { @@ -79,7 +76,7 @@ impl KeyPair { pub fn from_hex(hex: &str) -> Result<Self> { Ok(Self::from_bytes( - &data_encoding::HEXUPPER.decode(&hex.as_bytes())?, + &data_encoding::HEXUPPER.decode(hex.as_bytes())?, )?) } } @@ -218,7 +215,7 @@ fn test_did_secp256k1_p256() { ]; // test decode/encode did:key - for (hex, did) in pairs.iter() { + for (_hex, did) in pairs.iter() { assert_eq!(did, &PubKey::from_did_key(did).unwrap().to_did_key()); } |