Improve "Why this is bad" section

Co-authored-by: Ruby Lazuli <general@patchmixolydic.com>
This commit is contained in:
Isaac Bess 2024-09-02 17:00:32 -07:00 committed by Sour1emon
parent d7996da9da
commit 5515566829

View File

@ -13,7 +13,7 @@
/// Checks for expressions like `x.count_ones() == 1` or `x & (x - 1) == 0` which are manual
/// reimplementations of `x.is_power_of_two()``
/// ### Why is this bad?
/// It's simpler and clearer
/// Manual reimplementations of `is_power_of_two` increase code complexity for little benefit.
/// ### Example
/// ```no_run
/// let x: u32 = 1;