`needless_bool` should handle logical and/or
C-enhancement
### Description
The lint `needless_bool` should also trigger on `if x { true } else { y }` and `if x { y } else { false }`, suggesting `x || y` and `x && y` respectively. Some more variations:
- `if x { false } else { y }` -> `(!x) && y`
- `if x { x } else { y }` -> `x || y`
### Additional Labels
@rustbot label +C-enhancement
0 条评论