From 772f174cbcb747669216a3a284e63dc9fce1705c Mon Sep 17 00:00:00 2001 From: Borja Castellano Date: Wed, 6 May 2026 09:17:31 -0700 Subject: [PATCH] chore(dash-spv): forbid `std::sync::Mutex` / `RwLock` via clippy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a `clippy.toml` with `disallowed-types` for `std::sync::Mutex` and `std::sync::RwLock` so callers are nudged toward the tokio equivalents (the crate is async/tokio throughout — a blocking lock can stall the runtime). --- dash-spv/clippy.toml | 4 ++++ dash-spv/src/lib.rs | 2 ++ 2 files changed, 6 insertions(+) create mode 100644 dash-spv/clippy.toml diff --git a/dash-spv/clippy.toml b/dash-spv/clippy.toml new file mode 100644 index 000000000..960f88294 --- /dev/null +++ b/dash-spv/clippy.toml @@ -0,0 +1,4 @@ +disallowed-types = [ + { path = "std::sync::Mutex", reason = "Use tokio::sync::Mutex instead" }, + { path = "std::sync::RwLock", reason = "Use tokio::sync::RwLock instead" } +] diff --git a/dash-spv/src/lib.rs b/dash-spv/src/lib.rs index e166fdcd3..cabedf76a 100644 --- a/dash-spv/src/lib.rs +++ b/dash-spv/src/lib.rs @@ -59,6 +59,8 @@ //! - **Persistent storage**: Save and restore state between runs //! - **Extensive logging**: Built-in tracing support for debugging +#![deny(clippy::disallowed_types)] + #[cfg(any(test, feature = "test-utils"))] pub mod test_utils;