Explorar el Código

chore: clippy fixes

thesimplekid hace 1 mes
padre
commit
e11adf6156

+ 2 - 2
crates/cashu/src/nuts/nut00/mod.rs

@@ -135,7 +135,7 @@ fn total_amount<'a, I: Iterator<Item = &'a Proof>>(proofs: I) -> Result<Amount,
 }
 
 fn ys<'a, I: Iterator<Item = &'a Proof>>(proofs: I) -> Result<Vec<PublicKey>, Error> {
-    proofs.map(|p| p.y()).collect::<Result<Vec<PublicKey>, _>>()
+    proofs.map(Proof::y).collect::<Result<Vec<PublicKey>, _>>()
 }
 
 /// NUT00 Error
@@ -447,11 +447,11 @@ impl From<Proof> for ProofV4 {
     fn from(proof: Proof) -> ProofV4 {
         let Proof {
             amount,
-            keyset_id: _,
             secret,
             c,
             witness,
             dleq,
+            ..
         } = proof;
         ProofV4 {
             amount,

+ 1 - 1
crates/cashu/src/nuts/nut00/token.rs

@@ -611,7 +611,7 @@ impl TokenV4Token {
         let short_id = ShortKeysetId::from(keyset_id);
         Self {
             keyset_id: short_id,
-            proofs: proofs.into_iter().map(|p| p.into()).collect(),
+            proofs: proofs.into_iter().map(Into::into).collect(),
         }
     }
 }

+ 1 - 1
crates/cashu/src/nuts/nut10.rs

@@ -71,7 +71,7 @@ impl SecretData {
         Self {
             nonce,
             data: data.into(),
-            tags: tags.map(|v| v.into()),
+            tags: tags.map(Into::into),
         }
     }
 

+ 1 - 1
crates/cashu/src/nuts/nut14/mod.rs

@@ -179,7 +179,7 @@ impl Proof {
         let signatures = self
             .witness
             .as_ref()
-            .map(|w| w.signatures())
+            .map(super::nut00::Witness::signatures)
             .unwrap_or_default();
 
         self.witness = Some(Witness::HTLCWitness(HTLCWitness {

+ 1 - 1
crates/cashu/src/nuts/nut18/secret.rs

@@ -28,7 +28,7 @@ impl Nut10SecretRequest {
         Self {
             kind,
             data: data.into(),
-            tags: tags.map(|v| v.into()),
+            tags: tags.map(Into::into),
         }
     }
 }

+ 1 - 4
crates/cashu/src/nuts/nut23.rs

@@ -212,10 +212,7 @@ impl MeltQuoteBolt11Request {
     /// in the request for an amountless bolt11 or in MPP option.
     pub fn amount_msat(&self) -> Result<Amount, Error> {
         let MeltQuoteBolt11Request {
-            request,
-            unit: _,
-            options,
-            ..
+            request, options, ..
         } = self;
 
         match options {