]> Untitled Git - bdk/commitdiff
feat(chain): make output of `SpkTxOutIndex::unused_spks` cloneable
author志宇 <hello@evanlinjin.me>
Sat, 13 Jan 2024 11:57:30 +0000 (19:57 +0800)
committer志宇 <hello@evanlinjin.me>
Sat, 13 Jan 2024 12:07:02 +0000 (20:07 +0800)
This allows us to pass this to chain sources without calling
`Iterator::collect` first.

crates/chain/src/spk_txout_index.rs

index 8df1b119756e7a46534f5991971902467efb292b..90ee7dcab1a53dcf4c25d7ef69c25ac331c9f1ca 100644 (file)
@@ -215,7 +215,7 @@ impl<I: Clone + Ord> SpkTxOutIndex<I> {
     /// let unused_change_spks =
     ///     txout_index.unused_spks((change_index, u32::MIN)..(change_index, u32::MAX));
     /// ```
-    pub fn unused_spks<R>(&self, range: R) -> impl DoubleEndedIterator<Item = (&I, &Script)>
+    pub fn unused_spks<R>(&self, range: R) -> impl DoubleEndedIterator<Item = (&I, &Script)> + Clone
     where
         R: RangeBounds<I>,
     {