2018-04-07 03:23:27 -05:00
|
|
|
error: this boolean expression can be simplified
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/match_bool.rs:36:11
|
2018-04-07 03:23:27 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | match test && test {
|
2018-04-07 03:23:27 -05:00
|
|
|
| ^^^^^^^^^^^^ help: try: `test`
|
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
= note: `-D clippy::nonminimal-bool` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::nonminimal_bool)]`
|
2018-04-07 03:23:27 -05:00
|
|
|
|
|
|
|
error: you seem to be trying to match on a boolean expression
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/match_bool.rs:7:5
|
2018-10-06 11:18:06 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | / match test {
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | |
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | | true => 0,
|
|
|
|
LL | | false => 42,
|
|
|
|
LL | | };
|
2020-01-06 00:36:33 -06:00
|
|
|
| |_____^ help: consider using an `if`/`else` expression: `if test { 0 } else { 42 }`
|
2018-10-06 11:18:06 -05:00
|
|
|
|
|
2020-04-02 19:36:49 -05:00
|
|
|
note: the lint level is defined here
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/match_bool.rs:2:9
|
2020-04-02 19:36:49 -05:00
|
|
|
|
|
|
|
|
LL | #![deny(clippy::match_bool)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^
|
2018-04-07 03:23:27 -05:00
|
|
|
|
|
|
|
error: you seem to be trying to match on a boolean expression
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/match_bool.rs:14:5
|
2018-04-07 03:23:27 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | / match option == 1 {
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | |
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | | true => 1,
|
|
|
|
LL | | false => 0,
|
|
|
|
LL | | };
|
2020-01-06 00:36:33 -06:00
|
|
|
| |_____^ help: consider using an `if`/`else` expression: `if option == 1 { 1 } else { 0 }`
|
2018-04-07 03:23:27 -05:00
|
|
|
|
|
|
|
error: you seem to be trying to match on a boolean expression
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/match_bool.rs:20:5
|
2018-12-09 23:27:19 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | / match test {
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | |
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | | true => (),
|
|
|
|
LL | | false => {
|
|
|
|
LL | | println!("Noooo!");
|
|
|
|
LL | | },
|
|
|
|
LL | | };
|
2018-12-09 23:27:19 -06:00
|
|
|
| |_____^
|
2019-10-26 14:53:42 -05:00
|
|
|
|
|
2020-01-06 00:36:33 -06:00
|
|
|
help: consider using an `if`/`else` expression
|
2018-12-09 23:27:19 -06:00
|
|
|
|
|
2021-08-11 09:21:33 -05:00
|
|
|
LL ~ if !test {
|
|
|
|
LL + println!("Noooo!");
|
|
|
|
LL ~ };
|
2018-04-07 03:23:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
error: you seem to be trying to match on a boolean expression
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/match_bool.rs:28:5
|
2018-12-09 23:27:19 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | / match test {
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | |
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | | false => {
|
|
|
|
LL | | println!("Noooo!");
|
|
|
|
LL | | },
|
|
|
|
LL | | _ => (),
|
|
|
|
LL | | };
|
2018-12-09 23:27:19 -06:00
|
|
|
| |_____^
|
2019-10-26 14:53:42 -05:00
|
|
|
|
|
2020-01-06 00:36:33 -06:00
|
|
|
help: consider using an `if`/`else` expression
|
2018-12-09 23:27:19 -06:00
|
|
|
|
|
2021-08-11 09:21:33 -05:00
|
|
|
LL ~ if !test {
|
|
|
|
LL + println!("Noooo!");
|
|
|
|
LL ~ };
|
2018-04-07 03:23:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
error: you seem to be trying to match on a boolean expression
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/match_bool.rs:36:5
|
2018-12-09 23:27:19 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | / match test && test {
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | |
|
|
|
|
LL | |
|
|
|
|
LL | |
|
|
|
|
... |
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | | _ => (),
|
|
|
|
LL | | };
|
2018-12-09 23:27:19 -06:00
|
|
|
| |_____^
|
2019-10-26 14:53:42 -05:00
|
|
|
|
|
2020-01-06 00:36:33 -06:00
|
|
|
help: consider using an `if`/`else` expression
|
2018-12-09 23:27:19 -06:00
|
|
|
|
|
2021-08-11 09:21:33 -05:00
|
|
|
LL ~ if !(test && test) {
|
|
|
|
LL + println!("Noooo!");
|
|
|
|
LL ~ };
|
2018-04-07 03:23:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
error: equal expressions as operands to `&&`
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/match_bool.rs:36:11
|
2018-04-07 03:23:27 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | match test && test {
|
2018-04-07 03:23:27 -05:00
|
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
|
2019-07-18 17:35:32 -05:00
|
|
|
= note: `#[deny(clippy::eq_op)]` on by default
|
2018-04-07 03:23:27 -05:00
|
|
|
|
|
|
|
error: you seem to be trying to match on a boolean expression
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/match_bool.rs:48:5
|
2018-12-09 23:27:19 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | / match test {
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | |
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | | false => {
|
|
|
|
LL | | println!("Noooo!");
|
2018-12-09 23:27:19 -06:00
|
|
|
... |
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | | },
|
|
|
|
LL | | };
|
2018-12-09 23:27:19 -06:00
|
|
|
| |_____^
|
2019-10-26 14:53:42 -05:00
|
|
|
|
|
2020-01-06 00:36:33 -06:00
|
|
|
help: consider using an `if`/`else` expression
|
2018-12-09 23:27:19 -06:00
|
|
|
|
|
2021-08-11 09:21:33 -05:00
|
|
|
LL ~ if test {
|
|
|
|
LL + println!("Yes!");
|
|
|
|
LL + } else {
|
|
|
|
LL + println!("Noooo!");
|
|
|
|
LL ~ };
|
2018-04-07 03:23:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
error: aborting due to 8 previous errors
|
|
|
|
|