]> Untitled Git - bdk/commitdiff
Allow mutex_atomic
authorTobin Harding <me@tobin.cc>
Wed, 23 Dec 2020 04:58:57 +0000 (15:58 +1100)
committerTobin Harding <me@tobin.cc>
Wed, 24 Feb 2021 02:30:47 +0000 (13:30 +1100)
 Clippy complains about use of a mutex, suggesting we use an
 `AtomicUsize`. While the same functionality _could_ be achieved using an
 `AtomicUsize` and a CAS loop it makes the code harder to reason about
 for little gain. Lets just quieten clippy with an allow attribute and
 document why we did so.

src/blockchain/compact_filters/mod.rs

index 649c53dfa5316859e819e0e72e4b380c5e25cc79..6785d9239788c382c68eb3402c29c0fae66b4e3b 100644 (file)
@@ -239,6 +239,7 @@ impl Blockchain for CompactFiltersBlockchain {
         vec![Capability::FullHistory].into_iter().collect()
     }
 
+    #[allow(clippy::mutex_atomic)] // Mutex is easier to understand than a CAS loop.
     fn setup<D: BatchDatabase, P: 'static + Progress>(
         &self,
         _stop_gap: Option<usize>, // TODO: move to electrum and esplora only