From ba8ce7233d0e747b4c7bff2997641ecd9cdceea0 Mon Sep 17 00:00:00 2001 From: Tobin Harding Date: Wed, 23 Dec 2020 15:58:57 +1100 Subject: [PATCH] Allow mutex_atomic 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 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/blockchain/compact_filters/mod.rs b/src/blockchain/compact_filters/mod.rs index 649c53df..6785d923 100644 --- a/src/blockchain/compact_filters/mod.rs +++ b/src/blockchain/compact_filters/mod.rs @@ -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( &self, _stop_gap: Option, // TODO: move to electrum and esplora only