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