ソースを参照

`cashu-sdk` chore: clippy

thesimplekid 1 年間 前
コミット
c6f38f3cc8

+ 4 - 4
crates/cashu-sdk/src/mint.rs

@@ -58,7 +58,7 @@ impl Mint {
     /// Return a list of all supported keysets
     pub fn keysets(&self) -> nut02::Response {
         let mut keysets: HashSet<_> = self.inactive_keysets.keys().cloned().collect();
-        keysets.insert(self.active_keyset.id.clone());
+        keysets.insert(self.active_keyset.id);
         nut02::Response { keysets }
     }
 
@@ -84,7 +84,7 @@ impl Mint {
     ) {
         // Add current set to inactive keysets
         self.inactive_keysets
-            .insert(self.active_keyset.id.clone(), self.active_keyset.clone());
+            .insert(self.active_keyset.id, self.active_keyset.clone());
 
         self.active_keyset = KeySet::generate(secret, derivation_path, max_order);
     }
@@ -107,7 +107,7 @@ impl Mint {
     fn blind_sign(&self, blinded_message: &BlindedMessage) -> Result<BlindedSignature, Error> {
         let BlindedMessage { amount, b } = blinded_message;
 
-        let Some(key_pair) = self.active_keyset.keys.0.get(&amount) else {
+        let Some(key_pair) = self.active_keyset.keys.0.get(amount) else {
             // No key for amount
             return Err(Error::AmountKey);
         };
@@ -117,7 +117,7 @@ impl Mint {
         Ok(BlindedSignature {
             amount: *amount,
             c: c.into(),
-            id: self.active_keyset.id.clone(),
+            id: self.active_keyset.id,
         })
     }
 

+ 1 - 1
crates/cashu-sdk/src/wallet.rs

@@ -316,7 +316,7 @@ impl Wallet {
 
             let unblinded_sig = unblind_message(blinded_c, rs[i].clone().into(), a).unwrap();
             let proof = Proof {
-                id: Some(promise.id.clone()),
+                id: Some(promise.id),
                 amount: promise.amount,
                 secret: secrets[i].clone(),
                 c: unblinded_sig,

+ 2 - 2
crates/cashu/src/nuts/nut06.rs

@@ -41,14 +41,14 @@ impl SplitRequest {
 pub struct SplitResponse {
     /// Promises to keep
     #[deprecated(
-        since = "0.5.0",
+        since = "0.3.0",
         note = "mint only response with one list of all promises"
     )]
     #[serde(skip_serializing_if = "Option::is_none")]
     pub fst: Option<Vec<BlindedSignature>>,
     /// Promises to send
     #[deprecated(
-        since = "0.5.0",
+        since = "0.3.0",
         note = "mint only response with one list of all promises"
     )]
     #[serde(skip_serializing_if = "Option::is_none")]