summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo8it <mo8it@proton.me>2024-08-25 23:54:04 +0200
committermo8it <mo8it@proton.me>2024-08-25 23:54:04 +0200
commita1f0eaab549300dbd7d2dbd85cf11aba34f57c2d (patch)
treee5cbd4f7a4536663ae85bc88cb01a941ee3f5774
parentb1898f6d8b2c2ae45279ca4c67fa1b1a94acb936 (diff)
Add disallowed types and methods in Clippy
-rw-r--r--Cargo.toml2
-rw-r--r--clippy.toml13
2 files changed, 15 insertions, 0 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 5eb25b4..b332f40 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 0000000..81e372a
--- /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",
+]