Skip to content

Commit a1f0eaa

Browse files
committed
Add disallowed types and methods in Clippy
1 parent b1898f6 commit a1f0eaa

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ unstable_features = "forbid"
7575

7676
[workspace.lints.clippy]
7777
empty_loop = "forbid"
78+
disallowed-types = "deny"
79+
disallowed-methods = "deny"
7880
infinite_loop = "deny"
7981
mem_forget = "deny"
8082
dbg_macro = "warn"

clippy.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
disallowed-types = [
2+
# Inefficient. Use `.queue(…)` instead.
3+
"crossterm::style::Stylize",
4+
"crossterm::style::styled_content::StyledContent",
5+
]
6+
7+
disallowed-methods = [
8+
# We use `ahash` instead of the default hasher.
9+
"std::collections::HashSet::new",
10+
"std::collections::HashSet::with_capacity",
11+
# Inefficient. Use `.queue(…)` instead.
12+
"crossterm::style::style",
13+
]

0 commit comments

Comments
 (0)