diff options
| author | bors <bors@rust-lang.org> | 2021-07-09 06:39:56 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-07-09 06:39:56 +0000 |
| commit | 8da39e66accb19d655d8675fc523750dc7ddf207 (patch) | |
| tree | 3f99a0f6e51e940e0dc5772ec0b7f865b7543e0e /clippy_utils | |
| parent | 28e769951fd6ed98c625b4f2d9bab046034ca2f2 (diff) | |
| parent | 795868dd88dfd0ba88813f6683287af1aaf1b801 (diff) | |
| download | rust-8da39e66accb19d655d8675fc523750dc7ddf207.tar.gz rust-8da39e66accb19d655d8675fc523750dc7ddf207.zip | |
Auto merge of #7448 - flip1995:run_lints-rename, r=llogiq
Rename run_lints -> lints_enabled Just a quick rename of a utilities function. `run_lints` kinda suggested that the lints were run by this function. But the only thing this function does is to check if the lints are enabled in the context of the `hir_id` changelog: none
Diffstat (limited to 'clippy_utils')
| -rw-r--r-- | clippy_utils/src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clippy_utils/src/lib.rs b/clippy_utils/src/lib.rs index ef4854afc83..9f09027aadc 100644 --- a/clippy_utils/src/lib.rs +++ b/clippy_utils/src/lib.rs @@ -1546,12 +1546,12 @@ pub fn fn_def_id(cx: &LateContext<'_>, expr: &Expr<'_>) -> Option<DefId> { /// /// ```ignore /// #[deny(clippy::YOUR_AWESOME_LINT)] -/// println!("Hello, World!"); // <- Clippy code: run_lints(cx, &[YOUR_AWESOME_LINT], id) == true +/// println!("Hello, World!"); // <- Clippy code: lints_enabled(cx, &[YOUR_AWESOME_LINT], id) == true /// /// #[allow(clippy::YOUR_AWESOME_LINT)] -/// println!("See you soon!"); // <- Clippy code: run_lints(cx, &[YOUR_AWESOME_LINT], id) == false +/// println!("See you soon!"); // <- Clippy code: lints_enabled(cx, &[YOUR_AWESOME_LINT], id) == false /// ``` -pub fn run_lints(cx: &LateContext<'_>, lints: &[&'static Lint], id: HirId) -> bool { +pub fn lints_enabled(cx: &LateContext<'_>, lints: &[&'static Lint], id: HirId) -> bool { lints.iter().any(|lint| { matches!( cx.tcx.lint_level_at_node(lint, id), |
