diff options
| author | Asuna <SpriteOvO@gmail.com> | 2024-10-15 21:27:46 +0200 |
|---|---|---|
| committer | Asuna <SpriteOvO@gmail.com> | 2024-10-15 21:27:46 +0200 |
| commit | ac81f176a8b241fd4a3afea9f5d01da6dd2fa623 (patch) | |
| tree | 65f19cc29ac1f55d3d856322d92ccc230ffd3d3e | |
| parent | f32862384e98d31d8b34eb5280b1960cbb5af339 (diff) | |
| download | rust-ac81f176a8b241fd4a3afea9f5d01da6dd2fa623.tar.gz rust-ac81f176a8b241fd4a3afea9f5d01da6dd2fa623.zip | |
Change the category of `manual_is_power_of_two` to `pedantic`
| -rw-r--r-- | clippy_lints/src/manual_is_power_of_two.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clippy_lints/src/manual_is_power_of_two.rs b/clippy_lints/src/manual_is_power_of_two.rs index b95bcafc12a..a11d3e4624c 100644 --- a/clippy_lints/src/manual_is_power_of_two.rs +++ b/clippy_lints/src/manual_is_power_of_two.rs @@ -11,10 +11,12 @@ use rustc_session::declare_lint_pass; declare_clippy_lint! { /// ### What it does - /// Checks for expressions like `x.count_ones() == 1` or `x & (x - 1) == 0`, with x and unsigned integer, which are manual + /// Checks for expressions like `x.count_ones() == 1` or `x & (x - 1) == 0`, with x and unsigned integer, which may be manual /// reimplementations of `x.is_power_of_two()`. + /// /// ### Why is this bad? /// Manual reimplementations of `is_power_of_two` increase code complexity for little benefit. + /// /// ### Example /// ```no_run /// let a: u32 = 4; @@ -27,7 +29,7 @@ declare_clippy_lint! { /// ``` #[clippy::version = "1.82.0"] pub MANUAL_IS_POWER_OF_TWO, - complexity, + pedantic, "manually reimplementing `is_power_of_two`" } |
