From a1f0eaab549300dbd7d2dbd85cf11aba34f57c2d Mon Sep 17 00:00:00 2001 From: mo8it Date: Sun, 25 Aug 2024 23:54:04 +0200 Subject: [PATCH] Add disallowed types and methods in Clippy --- Cargo.toml | 2 ++ clippy.toml | 13 +++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 clippy.toml diff --git a/Cargo.toml b/Cargo.toml index 5eb25b49..b332f40b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -75,6 +75,8 @@ unstable_features = "forbid" [workspace.lints.clippy] empty_loop = "forbid" +disallowed-types = "deny" +disallowed-methods = "deny" infinite_loop = "deny" mem_forget = "deny" dbg_macro = "warn" diff --git a/clippy.toml b/clippy.toml new file mode 100644 index 00000000..81e372a7 --- /dev/null +++ b/clippy.toml @@ -0,0 +1,13 @@ +disallowed-types = [ + # Inefficient. Use `.queue(…)` instead. + "crossterm::style::Stylize", + "crossterm::style::styled_content::StyledContent", +] + +disallowed-methods = [ + # We use `ahash` instead of the default hasher. + "std::collections::HashSet::new", + "std::collections::HashSet::with_capacity", + # Inefficient. Use `.queue(…)` instead. + "crossterm::style::style", +]