|
1 | 1 | error: redundant closure found |
2 | | - --> $DIR/eta.rs:21:27 |
| 2 | + --> $DIR/eta.rs:20:27 |
3 | 3 | | |
4 | 4 | LL | let a = Some(1u8).map(|a| foo(a)); |
5 | 5 | | ^^^^^^^^^^ help: remove closure as shown: `foo` |
6 | 6 | | |
7 | 7 | = note: `-D clippy::redundant-closure` implied by `-D warnings` |
8 | 8 |
|
9 | 9 | error: redundant closure found |
10 | | - --> $DIR/eta.rs:22:10 |
| 10 | + --> $DIR/eta.rs:21:10 |
11 | 11 | | |
12 | 12 | LL | meta(|a| foo(a)); |
13 | 13 | | ^^^^^^^^^^ help: remove closure as shown: `foo` |
14 | 14 |
|
15 | 15 | error: this expression borrows a reference that is immediately dereferenced by the compiler |
16 | | - --> $DIR/eta.rs:25:21 |
| 16 | + --> $DIR/eta.rs:24:21 |
17 | 17 | | |
18 | 18 | LL | all(&[1, 2, 3], &&2, |x, y| below(x, y)); //is adjusted |
19 | 19 | | ^^^ help: change this to: `&2` |
20 | 20 | | |
21 | 21 | = note: `-D clippy::needless-borrow` implied by `-D warnings` |
22 | 22 |
|
23 | 23 | error: redundant closure found |
24 | | - --> $DIR/eta.rs:32:27 |
| 24 | + --> $DIR/eta.rs:31:27 |
25 | 25 | | |
26 | 26 | LL | let e = Some(1u8).map(|a| generic(a)); |
27 | 27 | | ^^^^^^^^^^^^^^ help: remove closure as shown: `generic` |
28 | 28 |
|
29 | 29 | error: redundant closure found |
30 | | - --> $DIR/eta.rs:75:51 |
| 30 | + --> $DIR/eta.rs:74:51 |
31 | 31 | | |
32 | 32 | LL | let e = Some(TestStruct { some_ref: &i }).map(|a| a.foo()); |
33 | 33 | | ^^^^^^^^^^^ help: remove closure as shown: `TestStruct::foo` |
34 | 34 | | |
35 | 35 | = note: `-D clippy::redundant-closure-for-method-calls` implied by `-D warnings` |
36 | 36 |
|
37 | 37 | error: redundant closure found |
38 | | - --> $DIR/eta.rs:77:51 |
| 38 | + --> $DIR/eta.rs:76:51 |
39 | 39 | | |
40 | 40 | LL | let e = Some(TestStruct { some_ref: &i }).map(|a| a.trait_foo()); |
41 | 41 | | ^^^^^^^^^^^^^^^^^ help: remove closure as shown: `TestTrait::trait_foo` |
42 | 42 |
|
43 | 43 | error: redundant closure found |
44 | | - --> $DIR/eta.rs:80:42 |
| 44 | + --> $DIR/eta.rs:79:42 |
45 | 45 | | |
46 | 46 | LL | let e = Some(&mut vec![1, 2, 3]).map(|v| v.clear()); |
47 | 47 | | ^^^^^^^^^^^^^ help: remove closure as shown: `std::vec::Vec::clear` |
48 | 48 |
|
49 | 49 | error: redundant closure found |
50 | | - --> $DIR/eta.rs:85:29 |
| 50 | + --> $DIR/eta.rs:84:29 |
51 | 51 | | |
52 | 52 | LL | let e = Some("str").map(|s| s.to_string()); |
53 | 53 | | ^^^^^^^^^^^^^^^^^ help: remove closure as shown: `std::string::ToString::to_string` |
54 | 54 |
|
55 | 55 | error: redundant closure found |
56 | | - --> $DIR/eta.rs:87:27 |
| 56 | + --> $DIR/eta.rs:86:27 |
57 | 57 | | |
58 | 58 | LL | let e = Some('a').map(|s| s.to_uppercase()); |
59 | 59 | | ^^^^^^^^^^^^^^^^^^^^ help: remove closure as shown: `char::to_uppercase` |
60 | 60 |
|
61 | 61 | error: redundant closure found |
62 | | - --> $DIR/eta.rs:90:65 |
| 62 | + --> $DIR/eta.rs:89:65 |
63 | 63 | | |
64 | 64 | LL | let e: std::vec::Vec<char> = vec!['a', 'b', 'c'].iter().map(|c| c.to_ascii_uppercase()).collect(); |
65 | 65 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove closure as shown: `char::to_ascii_uppercase` |
66 | 66 |
|
67 | 67 | error: redundant closure found |
68 | | - --> $DIR/eta.rs:173:27 |
| 68 | + --> $DIR/eta.rs:172:27 |
69 | 69 | | |
70 | 70 | LL | let a = Some(1u8).map(|a| foo_ptr(a)); |
71 | 71 | | ^^^^^^^^^^^^^^ help: remove closure as shown: `foo_ptr` |
72 | 72 |
|
73 | 73 | error: redundant closure found |
74 | | - --> $DIR/eta.rs:178:27 |
| 74 | + --> $DIR/eta.rs:177:27 |
75 | 75 | | |
76 | 76 | LL | let a = Some(1u8).map(|a| closure(a)); |
77 | 77 | | ^^^^^^^^^^^^^^ help: remove closure as shown: `closure` |
|
0 commit comments