diff options
Diffstat (limited to 'src/tools/clippy/tests/ui/match_result_ok.stderr')
-rw-r--r-- | src/tools/clippy/tests/ui/match_result_ok.stderr | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/match_result_ok.stderr b/src/tools/clippy/tests/ui/match_result_ok.stderr new file mode 100644 index 000000000..cc3bc8c76 --- /dev/null +++ b/src/tools/clippy/tests/ui/match_result_ok.stderr @@ -0,0 +1,36 @@ +error: matching on `Some` with `ok()` is redundant + --> $DIR/match_result_ok.rs:10:5 + | +LL | if let Some(y) = x.parse().ok() { y } else { 0 } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `-D clippy::match-result-ok` implied by `-D warnings` +help: consider matching on `Ok(y)` and removing the call to `ok` instead + | +LL | if let Ok(y) = x.parse() { y } else { 0 } + | ~~~~~~~~~~~~~~~~~~~~~~~~ + +error: matching on `Some` with `ok()` is redundant + --> $DIR/match_result_ok.rs:20:9 + | +LL | if let Some(y) = x . parse() . ok () { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: consider matching on `Ok(y)` and removing the call to `ok` instead + | +LL | if let Ok(y) = x . parse() { + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +error: matching on `Some` with `ok()` is redundant + --> $DIR/match_result_ok.rs:46:5 + | +LL | while let Some(a) = wat.next().ok() { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: consider matching on `Ok(a)` and removing the call to `ok` instead + | +LL | while let Ok(a) = wat.next() { + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +error: aborting due to 3 previous errors + |