diff options
| author | Jacob Kiesel <kieseljake@live.com> | 2022-09-14 13:28:54 -0600 |
|---|---|---|
| committer | Jacob Kiesel <kieseljake@live.com> | 2022-09-14 13:35:35 -0600 |
| commit | 4ffdce09b6bbbeb6462f13cd2a3da311578a679f (patch) | |
| tree | 18696b427d8680e35b53d5e12df576cec5fe3365 /tests | |
| parent | 992560087025370e2a0397a67106b0852e238b4e (diff) | |
| download | rust-4ffdce09b6bbbeb6462f13cd2a3da311578a679f.tar.gz rust-4ffdce09b6bbbeb6462f13cd2a3da311578a679f.zip | |
refactor: use clippy_utils::Sugg instead of direct string ops
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/bool_to_int_with_if.fixed | 4 | ||||
| -rw-r--r-- | tests/ui/bool_to_int_with_if.stderr | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/ui/bool_to_int_with_if.fixed b/tests/ui/bool_to_int_with_if.fixed index c48dc941b84..2c8339cdd7f 100644 --- a/tests/ui/bool_to_int_with_if.fixed +++ b/tests/ui/bool_to_int_with_if.fixed @@ -22,12 +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)}; + } else { i32::from(!b) }; // Shouldn't lint diff --git a/tests/ui/bool_to_int_with_if.stderr b/tests/ui/bool_to_int_with_if.stderr index cc3e0395aa4..e695440f668 100644 --- a/tests/ui/bool_to_int_with_if.stderr +++ b/tests/ui/bool_to_int_with_if.stderr @@ -33,7 +33,7 @@ LL | | 0 LL | | }; | |_____^ help: replace with from: `i32::from(!a)` | - = note: `!a as i32` or `!a.into()` can also be valid options + = note: `!a as i32` or `(!a).into()` can also be valid options error: boolean to int conversion using if --> $DIR/bool_to_int_with_if.rs:30:5 @@ -80,7 +80,7 @@ LL | | 1 LL | | } else { LL | | 0 LL | | }; - | |_____^ help: replace with from: `{i32::from(b)}` + | |_____^ help: replace with from: `{ i32::from(b) }` | = note: `b as i32` or `b.into()` can also be valid options @@ -93,7 +93,7 @@ LL | | 0 LL | | } else { LL | | 1 LL | | }; - | |_____^ help: replace with from: `{i32::from(!b)}` + | |_____^ help: replace with from: `{ i32::from(!b) }` | = note: `!b as i32` or `(!b).into()` can also be valid options |
