diff options
Diffstat (limited to '')
-rw-r--r-- | src/tools/clippy/tests/ui/bool_to_int_with_if.fixed | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/tools/clippy/tests/ui/bool_to_int_with_if.fixed b/src/tools/clippy/tests/ui/bool_to_int_with_if.fixed index 9c1098dc4..2c8339cdd 100644 --- a/src/tools/clippy/tests/ui/bool_to_int_with_if.fixed +++ b/src/tools/clippy/tests/ui/bool_to_int_with_if.fixed @@ -14,6 +14,7 @@ fn main() { // precedence i32::from(a); i32::from(!a); + i32::from(!a); i32::from(a || b); i32::from(cond(a, b)); i32::from(x + y < 4); @@ -21,7 +22,12 @@ fn main() { // if else if if a { 123 - } else {i32::from(b)}; + } else { i32::from(b) }; + + // if else if inverted + if a { + 123 + } else { i32::from(!b) }; // Shouldn't lint |