File tree Expand file tree Collapse file tree 3 files changed +8
-14
lines changed Expand file tree Collapse file tree 3 files changed +8
-14
lines changed Original file line number Diff line number Diff line change 11// run-rustfix
22
33#![warn(clippy::while_let_some_result)]
4+ #![allow(clippy::boxed_local)]
45
56struct Wat {
67 counter: i32,
@@ -31,8 +32,8 @@ fn base_2(x: i32) {
3132 }
3233}
3334
34- fn base_3 (test_func: Box<Result<i32, &str>>) {
35- while let Some(b ) = test_func.ok() {}
35+ fn _base_3 (test_func: Box<Result<i32, &str>>) {
36+ while let Some(_b ) = test_func.ok() {}
3637}
3738
3839fn main() {
Original file line number Diff line number Diff line change 11// run-rustfix
22
33#![ warn( clippy:: while_let_some_result) ]
4+ #![ allow( clippy:: boxed_local) ]
45
56struct Wat {
67 counter : i32 ,
@@ -31,8 +32,8 @@ fn base_2(x: i32) {
3132 }
3233}
3334
34- fn base_3 ( test_func : Box < Result < i32 , & str > > ) {
35- while let Some ( b ) = test_func. ok ( ) { }
35+ fn _base_3 ( test_func : Box < Result < i32 , & str > > ) {
36+ while let Some ( _b ) = test_func. ok ( ) { }
3637}
3738
3839fn main ( ) {
Original file line number Diff line number Diff line change 11error: matching on `Some` with `ok()` is redundant
2- --> $DIR/while_let_some_result.rs:22 :5
2+ --> $DIR/while_let_some_result.rs:23 :5
33 |
44LL | while let Some(a) = wat.next().ok() {
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -10,13 +10,5 @@ help: consider matching on `Ok(a)` and removing the call to `ok` instead
1010LL | while let Ok(a) = wat.next() {
1111 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1212
13- error: local variable doesn't need to be boxed here
14- --> $DIR/while_let_some_result.rs:34:11
15- |
16- LL | fn base_3(test_func: Box<Result<i32, &str>>) {
17- | ^^^^^^^^^
18- |
19- = note: `-D clippy::boxed-local` implied by `-D warnings`
20-
21- error: aborting due to 2 previous errors
13+ error: aborting due to previous error
2214
You can’t perform that action at this time.
0 commit comments