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