about summary refs log tree commit diff
path: root/clippy_utils
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-07-09 06:39:56 +0000
committerbors <bors@rust-lang.org>2021-07-09 06:39:56 +0000
commit8da39e66accb19d655d8675fc523750dc7ddf207 (patch)
tree3f99a0f6e51e940e0dc5772ec0b7f865b7543e0e /clippy_utils
parent28e769951fd6ed98c625b4f2d9bab046034ca2f2 (diff)
parent795868dd88dfd0ba88813f6683287af1aaf1b801 (diff)
downloadrust-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.rs6
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),