mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
213 lines
6.2 KiB
Text
213 lines
6.2 KiB
Text
error: called `unwrap` on `x` after checking its variant with `is_ok`
|
|
--> $DIR/complex_conditionals.rs:13:9
|
|
|
|
|
LL | if x.is_ok() && y.is_err() {
|
|
| --------- the check is happening here
|
|
LL | // unnecessary
|
|
LL | x.unwrap();
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: try using `if let` or `match`
|
|
note: the lint level is defined here
|
|
--> $DIR/complex_conditionals.rs:1:35
|
|
|
|
|
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: this call to `unwrap_err()` will always panic
|
|
--> $DIR/complex_conditionals.rs:15:9
|
|
|
|
|
LL | if x.is_ok() && y.is_err() {
|
|
| --------- because of this check
|
|
...
|
|
LL | x.unwrap_err();
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
note: the lint level is defined here
|
|
--> $DIR/complex_conditionals.rs:1:9
|
|
|
|
|
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: this call to `unwrap()` will always panic
|
|
--> $DIR/complex_conditionals.rs:17:9
|
|
|
|
|
LL | if x.is_ok() && y.is_err() {
|
|
| ---------- because of this check
|
|
...
|
|
LL | y.unwrap();
|
|
| ^^^^^^^^^^
|
|
|
|
error: called `unwrap_err` on `y` after checking its variant with `is_err`
|
|
--> $DIR/complex_conditionals.rs:19:9
|
|
|
|
|
LL | if x.is_ok() && y.is_err() {
|
|
| ---------- the check is happening here
|
|
...
|
|
LL | y.unwrap_err();
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: try using `if let` or `match`
|
|
|
|
error: this call to `unwrap()` will always panic
|
|
--> $DIR/complex_conditionals.rs:34:9
|
|
|
|
|
LL | if x.is_ok() || y.is_ok() {
|
|
| --------- because of this check
|
|
...
|
|
LL | x.unwrap();
|
|
| ^^^^^^^^^^
|
|
|
|
error: called `unwrap_err` on `x` after checking its variant with `is_ok`
|
|
--> $DIR/complex_conditionals.rs:36:9
|
|
|
|
|
LL | if x.is_ok() || y.is_ok() {
|
|
| --------- the check is happening here
|
|
...
|
|
LL | x.unwrap_err();
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: try using `if let` or `match`
|
|
|
|
error: this call to `unwrap()` will always panic
|
|
--> $DIR/complex_conditionals.rs:38:9
|
|
|
|
|
LL | if x.is_ok() || y.is_ok() {
|
|
| --------- because of this check
|
|
...
|
|
LL | y.unwrap();
|
|
| ^^^^^^^^^^
|
|
|
|
error: called `unwrap_err` on `y` after checking its variant with `is_ok`
|
|
--> $DIR/complex_conditionals.rs:40:9
|
|
|
|
|
LL | if x.is_ok() || y.is_ok() {
|
|
| --------- the check is happening here
|
|
...
|
|
LL | y.unwrap_err();
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: try using `if let` or `match`
|
|
|
|
error: called `unwrap` on `x` after checking its variant with `is_ok`
|
|
--> $DIR/complex_conditionals.rs:45:9
|
|
|
|
|
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
|
| --------- the check is happening here
|
|
LL | // unnecessary
|
|
LL | x.unwrap();
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: try using `if let` or `match`
|
|
|
|
error: this call to `unwrap_err()` will always panic
|
|
--> $DIR/complex_conditionals.rs:47:9
|
|
|
|
|
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
|
| --------- because of this check
|
|
...
|
|
LL | x.unwrap_err();
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
error: this call to `unwrap()` will always panic
|
|
--> $DIR/complex_conditionals.rs:49:9
|
|
|
|
|
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
|
| --------- because of this check
|
|
...
|
|
LL | y.unwrap();
|
|
| ^^^^^^^^^^
|
|
|
|
error: called `unwrap_err` on `y` after checking its variant with `is_ok`
|
|
--> $DIR/complex_conditionals.rs:51:9
|
|
|
|
|
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
|
| --------- the check is happening here
|
|
...
|
|
LL | y.unwrap_err();
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: try using `if let` or `match`
|
|
|
|
error: called `unwrap` on `z` after checking its variant with `is_err`
|
|
--> $DIR/complex_conditionals.rs:53:9
|
|
|
|
|
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
|
| ---------- the check is happening here
|
|
...
|
|
LL | z.unwrap();
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: try using `if let` or `match`
|
|
|
|
error: this call to `unwrap_err()` will always panic
|
|
--> $DIR/complex_conditionals.rs:55:9
|
|
|
|
|
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
|
| ---------- because of this check
|
|
...
|
|
LL | z.unwrap_err();
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
error: this call to `unwrap()` will always panic
|
|
--> $DIR/complex_conditionals.rs:64:9
|
|
|
|
|
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
|
| --------- because of this check
|
|
...
|
|
LL | x.unwrap();
|
|
| ^^^^^^^^^^
|
|
|
|
error: called `unwrap_err` on `x` after checking its variant with `is_ok`
|
|
--> $DIR/complex_conditionals.rs:66:9
|
|
|
|
|
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
|
| --------- the check is happening here
|
|
...
|
|
LL | x.unwrap_err();
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: try using `if let` or `match`
|
|
|
|
error: called `unwrap` on `y` after checking its variant with `is_ok`
|
|
--> $DIR/complex_conditionals.rs:68:9
|
|
|
|
|
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
|
| --------- the check is happening here
|
|
...
|
|
LL | y.unwrap();
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: try using `if let` or `match`
|
|
|
|
error: this call to `unwrap_err()` will always panic
|
|
--> $DIR/complex_conditionals.rs:70:9
|
|
|
|
|
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
|
| --------- because of this check
|
|
...
|
|
LL | y.unwrap_err();
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
error: this call to `unwrap()` will always panic
|
|
--> $DIR/complex_conditionals.rs:72:9
|
|
|
|
|
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
|
| ---------- because of this check
|
|
...
|
|
LL | z.unwrap();
|
|
| ^^^^^^^^^^
|
|
|
|
error: called `unwrap_err` on `z` after checking its variant with `is_err`
|
|
--> $DIR/complex_conditionals.rs:74:9
|
|
|
|
|
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
|
| ---------- the check is happening here
|
|
...
|
|
LL | z.unwrap_err();
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: try using `if let` or `match`
|
|
|
|
error: aborting due to 20 previous errors
|
|
|