Skip to content

Commit 857a407

Browse files
Add reason config example for disallowed_type
Co-authored-by: James Hinshelwood <[email protected]>
1 parent 72078fa commit 857a407

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

clippy_lints/src/disallowed_type.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,15 @@ declare_clippy_lint! {
2121
/// An example clippy.toml configuration:
2222
/// ```toml
2323
/// # clippy.toml
24-
/// disallowed-types = ["std::collections::BTreeMap"]
24+
/// disallowed-types = [
25+
/// # Can use a string as the path of the disallowed type.
26+
/// "std::collections::BTreeMap",
27+
/// # Can also use an inline table with a `path` key.
28+
/// { path = "std::net::TcpListener" },
29+
/// # When using an inline table, can add a `reason` for why the type
30+
/// # is disallowed.
31+
/// { path = "std::net::Ipv4Addr", reason = "no IPv4 allowed" },
32+
/// ]
2533
/// ```
2634
///
2735
/// ```rust,ignore

0 commit comments

Comments
 (0)