chore: make clippy happy and bump clippy msrv
This commit is contained in:
@@ -168,9 +168,7 @@ impl<I: Clone + Ord> SpkTxOutIndex<I> {
|
||||
///
|
||||
/// Returns `None` if the `TxOut` hasn't been scanned or if nothing matching was found there.
|
||||
pub fn txout(&self, outpoint: OutPoint) -> Option<(&I, &TxOut)> {
|
||||
self.txouts
|
||||
.get(&outpoint)
|
||||
.map(|(spk_i, txout)| (spk_i, txout))
|
||||
self.txouts.get(&outpoint).map(|v| (&v.0, &v.1))
|
||||
}
|
||||
|
||||
/// Returns the script that has been inserted at the `index`.
|
||||
|
||||
@@ -581,10 +581,7 @@ impl<A: Clone + Ord> TxGraph<A> {
|
||||
}
|
||||
|
||||
for (outpoint, txout) in changeset.txouts {
|
||||
let tx_entry = self
|
||||
.txs
|
||||
.entry(outpoint.txid)
|
||||
.or_insert_with(Default::default);
|
||||
let tx_entry = self.txs.entry(outpoint.txid).or_default();
|
||||
|
||||
match tx_entry {
|
||||
(TxNodeInternal::Whole(_), _, _) => { /* do nothing since we already have full tx */
|
||||
@@ -597,13 +594,13 @@ impl<A: Clone + Ord> TxGraph<A> {
|
||||
|
||||
for (anchor, txid) in changeset.anchors {
|
||||
if self.anchors.insert((anchor.clone(), txid)) {
|
||||
let (_, anchors, _) = self.txs.entry(txid).or_insert_with(Default::default);
|
||||
let (_, anchors, _) = self.txs.entry(txid).or_default();
|
||||
anchors.insert(anchor);
|
||||
}
|
||||
}
|
||||
|
||||
for (txid, new_last_seen) in changeset.last_seen {
|
||||
let (_, _, last_seen) = self.txs.entry(txid).or_insert_with(Default::default);
|
||||
let (_, _, last_seen) = self.txs.entry(txid).or_default();
|
||||
if new_last_seen > *last_seen {
|
||||
*last_seen = new_last_seen;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
mod tx_template;
|
||||
#[allow(unused_imports)]
|
||||
pub use tx_template::*;
|
||||
|
||||
#[allow(unused_macros)]
|
||||
|
||||
Reference in New Issue
Block a user