]> Untitled Git - bdk/commitdiff
chore(bitcoind_rpc): Make clippy happy
author志宇 <hello@evanlinjin.me>
Thu, 10 Jul 2025 03:04:24 +0000 (03:04 +0000)
committer志宇 <hello@evanlinjin.me>
Thu, 10 Jul 2025 02:13:09 +0000 (02:13 +0000)
crates/bitcoind_rpc/src/lib.rs

index ac0d190ca28ba853d3d5d385b1fa9d9fd8cd9bec..2c2ca35a8e15be3301cf2ca4abe115d9acfc4915 100644 (file)
@@ -141,12 +141,10 @@ where
             }
         }
 
-        let mut mempool_event = MempoolEvent::default();
-
-        mempool_event.update = rpc_mempool
-            .into_iter()
-            .filter_map({
-                |txid| -> Option<Result<_, bitcoincore_rpc::Error>> {
+        let mut mempool_event = MempoolEvent {
+            update: rpc_mempool
+                .into_iter()
+                .filter_map(|txid| -> Option<Result<_, bitcoincore_rpc::Error>> {
                     let tx = match self.mempool_snapshot.get(&txid) {
                         Some(tx) => tx.clone(),
                         None => match client.get_raw_transaction(&txid, None) {
@@ -160,9 +158,10 @@ where
                         },
                     };
                     Some(Ok((tx, sync_time)))
-                }
-            })
-            .collect::<Result<Vec<_>, _>>()?;
+                })
+                .collect::<Result<Vec<_>, _>>()?,
+            ..Default::default()
+        };
 
         let at_tip =
             rpc_tip_height == self.last_cp.height() as u64 && rpc_tip_hash == self.last_cp.hash();