about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-11-10 19:37:05 +0000
committerbors <bors@rust-lang.org>2022-11-10 19:37:05 +0000
commit3c0ad8a0e0be83e922cb1ad59b10e69afe2aa754 (patch)
treec3c2dfd68985f61030658ed62c5b99fd4075c335
parent4f1698db60e309884e9a7ccdc85e5dad7b84a28a (diff)
parent3790aa3d5d14ef79b27776767985716844861f33 (diff)
downloadrust-3c0ad8a0e0be83e922cb1ad59b10e69afe2aa754.tar.gz
rust-3c0ad8a0e0be83e922cb1ad59b10e69afe2aa754.zip
Auto merge of #9830 - hrxi:pr_bool_to_int_with_if, r=Manishearth
Make `bool_to_int_with_if` a pedantic lint

In all the cases I've observed, it did not make the code clearer. Using bools as integer is frowned upon in some languages, in others it's simply not possible.

You can find comments on the original pull request #8131 that agree with this point of view.

changelog: [`bool_to_int_with_if`]: Change the categorization to pedantic
-rw-r--r--clippy_lints/src/bool_to_int_with_if.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/clippy_lints/src/bool_to_int_with_if.rs b/clippy_lints/src/bool_to_int_with_if.rs
index 40ded405669..bdb3a011602 100644
--- a/clippy_lints/src/bool_to_int_with_if.rs
+++ b/clippy_lints/src/bool_to_int_with_if.rs
@@ -13,7 +13,7 @@ declare_clippy_lint! {
     /// this lint suggests using a `from()` function or an `as` coercion.
     ///
     /// ### Why is this bad?
-    /// Coercion or `from()` is idiomatic way to convert bool to a number.
+    /// Coercion or `from()` is another way to convert bool to a number.
     /// Both methods are guaranteed to return 1 for true, and 0 for false.
     ///
     /// See https://doc.rust-lang.org/std/primitive.bool.html#impl-From%3Cbool%3E
@@ -39,7 +39,7 @@ declare_clippy_lint! {
     /// ```
     #[clippy::version = "1.65.0"]
     pub BOOL_TO_INT_WITH_IF,
-    style,
+    pedantic,
     "using if to convert bool to int"
 }
 declare_lint_pass!(BoolToIntWithIf => [BOOL_TO_INT_WITH_IF]);