fixup! Remove requirement of fully qualified path for disallowed_method/type
This commit is contained in:
parent
70ce0c2c55
commit
d4eff81282
@ -13,21 +13,14 @@ declare_clippy_lint! {
|
||||
/// **Why is this bad?** Some methods are undesirable in certain contexts,
|
||||
/// and it's beneficial to lint for them as needed.
|
||||
///
|
||||
/// **Known problems:** Currently, you must write each function as a
|
||||
/// fully-qualified path. This lint doesn't support aliases or reexported
|
||||
/// names; be aware that many types in `std` are actually reexports.
|
||||
///
|
||||
/// For example, if you want to disallow `Duration::as_secs`, your clippy.toml
|
||||
/// configuration would look like
|
||||
/// `disallowed-methods = ["core::time::Duration::as_secs"]` and not
|
||||
/// `disallowed-methods = ["std::time::Duration::as_secs"]` as you might expect.
|
||||
/// **Known problems:** None.
|
||||
///
|
||||
/// **Example:**
|
||||
///
|
||||
/// An example clippy.toml configuration:
|
||||
/// ```toml
|
||||
/// # clippy.toml
|
||||
/// disallowed-methods = ["alloc::vec::Vec::leak", "std::time::Instant::now"]
|
||||
/// disallowed-methods = ["std::vec::Vec::leak", "std::time::Instant::now"]
|
||||
/// ```
|
||||
///
|
||||
/// ```rust,ignore
|
||||
|
@ -13,14 +13,7 @@ declare_clippy_lint! {
|
||||
///
|
||||
/// **Why is this bad?** Some types are undesirable in certain contexts.
|
||||
///
|
||||
/// **Known problems:** The fully qualified path must be used. This lint
|
||||
/// doesn't support aliases or reexported names; be aware that many types
|
||||
/// in `std` are actually reexports.
|
||||
///
|
||||
/// For example, if you want to disallow `BTreeMap`, your clippy.toml
|
||||
/// configuration would look like
|
||||
/// `disallowed-methods = ["alloc::collections::btree::map::BTreeMap"]` and not
|
||||
/// `disallowed-methods = ["std::collections::BTreeMap"]` as you might expect.
|
||||
/// **Known problems:** None.
|
||||
///
|
||||
/// N.B. There is no way to ban primitive types.
|
||||
///
|
||||
@ -29,7 +22,7 @@ declare_clippy_lint! {
|
||||
/// An example clippy.toml configuration:
|
||||
/// ```toml
|
||||
/// # clippy.toml
|
||||
/// disallowed-methods = ["alloc::collections::btree::map::BTreeMap"]
|
||||
/// disallowed-methods = ["std::collections::BTreeMap"]
|
||||
/// ```
|
||||
///
|
||||
/// ```rust,ignore
|
||||
|
Loading…
x
Reference in New Issue
Block a user