diff --git a/src/crypto/nonce.rs b/src/crypto/nonce.rs index 5609ca8..ee1a3b5 100644 --- a/src/crypto/nonce.rs +++ b/src/crypto/nonce.rs @@ -31,7 +31,6 @@ impl PartialEq for Nonce { (Nonce::Custom(a), Nonce::Custom(b)) => a == b, (Nonce::Custom(a), Nonce::Nonce16(b)) => a.as_slice() == b, (Nonce::Nonce16(a), Nonce::Custom(b)) => a == b.as_slice(), - _ => false, } } } diff --git a/src/delegation/agent.rs b/src/delegation/agent.rs index c439505..9b05087 100644 --- a/src/delegation/agent.rs +++ b/src/delegation/agent.rs @@ -68,7 +68,6 @@ where now: SystemTime, varsig_header: V, ) -> Result, DelegateError> { - let mut salt = self.did.clone().to_string().into_bytes(); let nonce = Nonce::generate_16(); let (subject, policy) = match subject { diff --git a/src/delegation/store/memory.rs b/src/delegation/store/memory.rs index 0a7d22a..bf1c4ca 100644 --- a/src/delegation/store/memory.rs +++ b/src/delegation/store/memory.rs @@ -160,7 +160,7 @@ where let mut tx = self.lock(); tx.index - .entry(delegation.subject().clone()) + .entry(delegation.subject().cloned()) .or_default() .entry(delegation.audience().clone()) .or_default() @@ -251,7 +251,7 @@ where let issuer = delegation.issuer().clone(); // Hit a root delegation, AKA base case - if &Some(issuer.clone()) == delegation.subject() { + if Some(&issuer) == delegation.subject() { break 'outer; } diff --git a/src/invocation/agent.rs b/src/invocation/agent.rs index 00cf243..ee040a2 100644 --- a/src/invocation/agent.rs +++ b/src/invocation/agent.rs @@ -4,20 +4,13 @@ use super::{ Invocation, }; use crate::{ - ability::{ - self, arguments, - arguments::Named, - command::ToCommand, - parse::{ParseAbility, ParseAbilityError}, - ucan::revoke::Revoke, - }, + ability::{self, arguments, arguments::Named, command::ToCommand, parse::ParseAbility}, crypto::{ signature::{self, Envelope}, varsig, Nonce, }, delegation, did::{self, Did}, - invocation::payload::PayloadBuilder, time::Timestamp, }; use enum_as_inner::EnumAsInner; @@ -26,7 +19,7 @@ use libipld_core::{ codec::{Codec, Encode}, ipld::Ipld, }; -use std::{collections::BTreeMap, fmt, marker::PhantomData}; +use std::{collections::BTreeMap, marker::PhantomData}; use thiserror::Error; use web_time::SystemTime; diff --git a/src/ipld/cid.rs b/src/ipld/cid.rs index f812b2f..09d852a 100644 --- a/src/ipld/cid.rs +++ b/src/ipld/cid.rs @@ -130,8 +130,9 @@ impl Arbitrary for Newtype { // Very much faking it any::<([u8; 32], SomeMultihash, SomeCodec)>() .prop_map(|(hash_bytes, hasher, codec)| { - let multihash = MultihashGeneric::wrap(hasher.0.into(), &hash_bytes.as_slice()) - .expect("Sha2_256 should always successfully encode a hash"); + let multihash = + multihash::MultihashGeneric::wrap(hasher.0.into(), &hash_bytes.as_slice()) + .expect("Sha2_256 should always successfully encode a hash"); let cid = Cid::new_v1(codec.0.into(), multihash); Newtype { cid }