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 1
1
// run-rustfix
2
2
3
3
#![warn(clippy::while_let_some_result)]
4
+ #![allow(clippy::boxed_local)]
4
5
5
6
struct Wat {
6
7
counter: i32,
@@ -31,8 +32,8 @@ fn base_2(x: i32) {
31
32
}
32
33
}
33
34
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() {}
36
37
}
37
38
38
39
fn main() {
Original file line number Diff line number Diff line change 1
1
// run-rustfix
2
2
3
3
#![ warn( clippy:: while_let_some_result) ]
4
+ #![ allow( clippy:: boxed_local) ]
4
5
5
6
struct Wat {
6
7
counter : i32 ,
@@ -31,8 +32,8 @@ fn base_2(x: i32) {
31
32
}
32
33
}
33
34
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 ( ) { }
36
37
}
37
38
38
39
fn main ( ) {
Original file line number Diff line number Diff line change 1
1
error: 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
3
3
|
4
4
LL | while let Some(a) = wat.next().ok() {
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -10,13 +10,5 @@ help: consider matching on `Ok(a)` and removing the call to `ok` instead
10
10
LL | while let Ok(a) = wat.next() {
11
11
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12
12
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
22
14
You can’t perform that action at this time.
0 commit comments