Auto merge of #13553 - SpriteOvO:manual_is_power_of_two-change-category, r=llogiq
Change the category of `manual_is_power_of_two` to `pedantic` Fixes #13547. The value being checked might be a bit flag, suggesting `is_power_of_two` for it would make the code unreadable. changelog: [`manual_is_power_of_two`]: Change the category to `pedantic`
This commit is contained in:
parent
4ff8ff0ecd
commit
7b688e21d6
1 changed files with 4 additions and 2 deletions
|
@ -11,10 +11,12 @@ use rustc_session::declare_lint_pass;
|
||||||
|
|
||||||
declare_clippy_lint! {
|
declare_clippy_lint! {
|
||||||
/// ### What it does
|
/// ### 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()`.
|
/// reimplementations of `x.is_power_of_two()`.
|
||||||
|
///
|
||||||
/// ### Why is this bad?
|
/// ### Why is this bad?
|
||||||
/// Manual reimplementations of `is_power_of_two` increase code complexity for little benefit.
|
/// Manual reimplementations of `is_power_of_two` increase code complexity for little benefit.
|
||||||
|
///
|
||||||
/// ### Example
|
/// ### Example
|
||||||
/// ```no_run
|
/// ```no_run
|
||||||
/// let a: u32 = 4;
|
/// let a: u32 = 4;
|
||||||
|
@ -27,7 +29,7 @@ declare_clippy_lint! {
|
||||||
/// ```
|
/// ```
|
||||||
#[clippy::version = "1.82.0"]
|
#[clippy::version = "1.82.0"]
|
||||||
pub MANUAL_IS_POWER_OF_TWO,
|
pub MANUAL_IS_POWER_OF_TWO,
|
||||||
complexity,
|
pedantic,
|
||||||
"manually reimplementing `is_power_of_two`"
|
"manually reimplementing `is_power_of_two`"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue