diff --git a/src/commands/mod.rs b/src/commands/mod.rs index 37c6486e..f125bf70 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -293,12 +293,10 @@ impl DaemonControl { /// Get a list of all known coins. pub fn list_coins(&self) -> ListCoinsResult { let mut db_conn = self.db.connection(); - #[allow(clippy::iter_kv_map)] // Because Rust 1.48 let coins: Vec = db_conn .coins(CoinType::All) - // Can't use into_values as of Rust 1.48 - .into_iter() - .map(|(_, coin)| { + .into_values() + .map(|coin| { let Coin { amount, outpoint, @@ -728,15 +726,12 @@ impl DaemonControl { let timelock = timelock.unwrap_or_else(|| self.config.main_descriptor.first_timelock_value()); let height_delta: i32 = timelock.try_into().expect("Must fit, it's a u16"); - let sweepable_coins = db_conn - .coins(CoinType::Unspent) - .into_iter() - .filter(|(_, c)| { - // We are interested in coins available at the *next* block - c.block_info - .map(|b| current_height + 1 >= b.height + height_delta) - .unwrap_or(false) - }); + let sweepable_coins = db_conn.coins(CoinType::Unspent).into_values().filter(|c| { + // We are interested in coins available at the *next* block + c.block_info + .map(|b| current_height + 1 >= b.height + height_delta) + .unwrap_or(false) + }); // Fill-in the transaction inputs and PSBT inputs information. Record the value // that is fed to the transaction while doing so, to compute the fees afterward. @@ -744,7 +739,7 @@ impl DaemonControl { let txin_sat_vb = self.config.main_descriptor.max_sat_vbytes(); let mut sat_vb = 0; let mut spent_txs = HashMap::new(); - for (_, coin) in sweepable_coins { + for coin in sweepable_coins { in_value += coin.amount; psbt.unsigned_tx.input.push(bitcoin::TxIn { previous_output: coin.outpoint,