From 29a1f7bb8b2b3e062a3ceaac90ad69b7d1c428d3 Mon Sep 17 00:00:00 2001 From: Jacob Kiesel Date: Tue, 13 Aug 2024 13:25:52 -0600 Subject: [PATCH] add clippy.toml to disallow methods --- clippy.toml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 clippy.toml diff --git a/clippy.toml b/clippy.toml new file mode 100644 index 0000000..66caece --- /dev/null +++ b/clippy.toml @@ -0,0 +1,18 @@ +disallowed-methods = [ + # These functions are very easy to misuse, please use `MaybeUninit` instead. + "std::mem::zeroed", + "std::mem::uninitialized", + # Unbounded memory growth is not approved for use. Use a bounded channel buffer. + "std::sync::mpsc::channel", + "tokio::sync::mpsc::unbounded_channel", + "crossbeam_channel::unbounded", + # These methods poll futures in a biased manner without containing the word "biased" in their name. + # This is a footgun and can result in the system starving itself out during high load scenarios. + # See https://github.com/rust-lang/futures-rs/issues/2135 for more. + "futures::future::select", + "futures_util::future::select", + "futures::future::try_select", + "futures_util::future::try_select", + "futures::future::select_ok", + "futures_util::future::select_ok", +]