#TIL that you can disallow certain types in your #Rust code with #Clippy (since 1.55):
https://nnethercote.github.io/perf-book/linting.html#disallowing-types
This is useful, if you e.g. want to use a faster HashMap (e.g. from ahash) and not the std HashMap.
Official docs:
https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_type
@schlink Yeah, what I really like is that you can also provide a reason in your clippy.toml on _why_ you've disallowed the type. Excerpt from their docs:
# clippy.toml
disallowed-types = [
# When using an inline table, can add a `reason` for why the type
# is disallowed.
{ path = "std::net::Ipv4Addr", reason = "no IPv4 allowed" },
]
The Rust folks are just awesome! ❤️