Skip to content

Commit

Permalink
Change the category of manual_is_power_of_two to pedantic
Browse files Browse the repository at this point in the history
  • Loading branch information
SpriteOvO committed Oct 15, 2024
1 parent f328623 commit ac81f17
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions clippy_lints/src/manual_is_power_of_two.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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`"
}

Expand Down

0 comments on commit ac81f17

Please sign in to comment.