Kaynağa Gözat

chore(bindings): clippy fixes

thesimplekid 11 ay önce
ebeveyn
işleme
8cbdaf39cc

+ 1 - 1
bindings/cdk-js/src/nuts/nut00/blind_signature.rs

@@ -34,7 +34,7 @@ impl JsBlindSignature {
             inner: BlindSignature {
                 keyset_id: *keyset_id.deref(),
                 amount: *amount.deref(),
-                c: c.deref().clone(),
+                c: *c.deref(),
                 dleq: dleq.map(|b| b.deref().clone()),
             },
         }

+ 2 - 2
bindings/cdk-js/src/nuts/nut00/blinded_message.rs

@@ -39,7 +39,7 @@ impl JsBlindedMessage {
             inner: BlindedMessage {
                 keyset_id: *keyset_id.deref(),
                 amount: *amount.deref(),
-                blinded_secret: blinded_secret.deref().clone(),
+                blinded_secret: *blinded_secret.deref(),
                 witness: witness.map(|w| w.deref().clone()),
             },
         }
@@ -60,7 +60,7 @@ impl JsBlindedMessage {
     /// Blinded Secret
     #[wasm_bindgen(getter)]
     pub fn blinded_secret(&self) -> JsPublicKey {
-        self.inner.blinded_secret.clone().into()
+        self.inner.blinded_secret.into()
     }
 
     /// Witness

+ 2 - 2
bindings/cdk-js/src/nuts/nut00/proof.rs

@@ -42,7 +42,7 @@ impl JsProof {
             inner: Proof {
                 amount: *amount.deref(),
                 secret: secret.deref().clone(),
-                c: c.deref().clone(),
+                c: *c.deref(),
                 keyset_id: *keyset_id.deref(),
                 witness: witness.map(|w| w.deref().clone()),
                 dleq: dleq.map(|d| d.deref().clone()),
@@ -65,7 +65,7 @@ impl JsProof {
     /// C
     #[wasm_bindgen(getter)]
     pub fn c(&self) -> JsPublicKey {
-        self.inner.c.clone().into()
+        self.inner.c.into()
     }
 
     /// Keyset Id

+ 2 - 2
bindings/cdk-js/src/nuts/nut06.rs

@@ -81,7 +81,7 @@ impl JsMintInfo {
         Ok(JsMintInfo {
             inner: MintInfo {
                 name,
-                pubkey: pubkey.map(|p| p.deref().clone()),
+                pubkey: pubkey.map(|p| *p.deref()),
                 version: version.map(|v| v.deref().clone()),
                 description,
                 description_long,
@@ -101,7 +101,7 @@ impl JsMintInfo {
     /// Get Pubkey
     #[wasm_bindgen(getter)]
     pub fn pubkey(&self) -> Option<JsPublicKey> {
-        self.inner.pubkey.clone().map(|p| p.into())
+        self.inner.pubkey.map(|p| p.into())
     }
 
     /// Get Version

+ 1 - 1
bindings/cdk-js/src/types/amount.rs

@@ -36,7 +36,7 @@ impl JsAmount {
     #[wasm_bindgen(constructor)]
     pub fn new(sats: u64) -> Self {
         Self {
-            inner: Amount::from(sats as u64),
+            inner: Amount::from(sats),
         }
     }