@@ -31,129 +31,129 @@ LL | let e = Some(1u8).map(|a| generic(a));
31
31
| ^^^^^^^^^^^^^^ help: replace the closure with the function itself: `generic`
32
32
33
33
error: redundant closure
34
- --> $DIR/eta.rs:87 :51
34
+ --> $DIR/eta.rs:93 :51
35
35
|
36
36
LL | let e = Some(TestStruct { some_ref: &i }).map(|a| a.foo());
37
37
| ^^^^^^^^^^^ help: replace the closure with the method itself: `TestStruct::foo`
38
38
|
39
39
= note: `-D clippy::redundant-closure-for-method-calls` implied by `-D warnings`
40
40
41
41
error: redundant closure
42
- --> $DIR/eta.rs:88 :51
42
+ --> $DIR/eta.rs:94 :51
43
43
|
44
44
LL | let e = Some(TestStruct { some_ref: &i }).map(|a| a.trait_foo());
45
45
| ^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `TestTrait::trait_foo`
46
46
47
47
error: redundant closure
48
- --> $DIR/eta.rs:90 :42
48
+ --> $DIR/eta.rs:96 :42
49
49
|
50
50
LL | let e = Some(&mut vec![1, 2, 3]).map(|v| v.clear());
51
51
| ^^^^^^^^^^^^^ help: replace the closure with the method itself: `std::vec::Vec::clear`
52
52
53
53
error: redundant closure
54
- --> $DIR/eta.rs:94 :29
54
+ --> $DIR/eta.rs:100 :29
55
55
|
56
56
LL | let e = Some("str").map(|s| s.to_string());
57
57
| ^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `std::string::ToString::to_string`
58
58
59
59
error: redundant closure
60
- --> $DIR/eta.rs:95 :27
60
+ --> $DIR/eta.rs:101 :27
61
61
|
62
62
LL | let e = Some('a').map(|s| s.to_uppercase());
63
63
| ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `char::to_uppercase`
64
64
65
65
error: redundant closure
66
- --> $DIR/eta.rs:97 :65
66
+ --> $DIR/eta.rs:103 :65
67
67
|
68
68
LL | let e: std::vec::Vec<char> = vec!['a', 'b', 'c'].iter().map(|c| c.to_ascii_uppercase()).collect();
69
69
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `char::to_ascii_uppercase`
70
70
71
71
error: redundant closure
72
- --> $DIR/eta.rs:160 :22
72
+ --> $DIR/eta.rs:166 :22
73
73
|
74
74
LL | requires_fn_once(|| x());
75
75
| ^^^^^^ help: replace the closure with the function itself: `x`
76
76
77
77
error: redundant closure
78
- --> $DIR/eta.rs:167 :27
78
+ --> $DIR/eta.rs:173 :27
79
79
|
80
80
LL | let a = Some(1u8).map(|a| foo_ptr(a));
81
81
| ^^^^^^^^^^^^^^ help: replace the closure with the function itself: `foo_ptr`
82
82
83
83
error: redundant closure
84
- --> $DIR/eta.rs:172 :27
84
+ --> $DIR/eta.rs:178 :27
85
85
|
86
86
LL | let a = Some(1u8).map(|a| closure(a));
87
87
| ^^^^^^^^^^^^^^ help: replace the closure with the function itself: `closure`
88
88
89
89
error: redundant closure
90
- --> $DIR/eta.rs:204 :28
90
+ --> $DIR/eta.rs:210 :28
91
91
|
92
92
LL | x.into_iter().for_each(|x| add_to_res(x));
93
93
| ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `&mut add_to_res`
94
94
95
95
error: redundant closure
96
- --> $DIR/eta.rs:205 :28
96
+ --> $DIR/eta.rs:211 :28
97
97
|
98
98
LL | y.into_iter().for_each(|x| add_to_res(x));
99
99
| ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `&mut add_to_res`
100
100
101
101
error: redundant closure
102
- --> $DIR/eta.rs:206 :28
102
+ --> $DIR/eta.rs:212 :28
103
103
|
104
104
LL | z.into_iter().for_each(|x| add_to_res(x));
105
105
| ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `add_to_res`
106
106
107
107
error: redundant closure
108
- --> $DIR/eta.rs:213 :21
108
+ --> $DIR/eta.rs:219 :21
109
109
|
110
110
LL | Some(1).map(|n| closure(n));
111
111
| ^^^^^^^^^^^^^^ help: replace the closure with the function itself: `&mut closure`
112
112
113
113
error: redundant closure
114
- --> $DIR/eta.rs:217 :21
114
+ --> $DIR/eta.rs:223 :21
115
115
|
116
116
LL | Some(1).map(|n| in_loop(n));
117
117
| ^^^^^^^^^^^^^^ help: replace the closure with the function itself: `in_loop`
118
118
119
119
error: redundant closure
120
- --> $DIR/eta.rs:310 :18
120
+ --> $DIR/eta.rs:316 :18
121
121
|
122
122
LL | takes_fn_mut(|| f());
123
123
| ^^^^^^ help: replace the closure with the function itself: `&mut f`
124
124
125
125
error: redundant closure
126
- --> $DIR/eta.rs:313 :19
126
+ --> $DIR/eta.rs:319 :19
127
127
|
128
128
LL | takes_fn_once(|| f());
129
129
| ^^^^^^ help: replace the closure with the function itself: `&mut f`
130
130
131
131
error: redundant closure
132
- --> $DIR/eta.rs:317 :26
132
+ --> $DIR/eta.rs:323 :26
133
133
|
134
134
LL | move || takes_fn_mut(|| f_used_once())
135
135
| ^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `&mut f_used_once`
136
136
137
137
error: redundant closure
138
- --> $DIR/eta.rs:329 :19
138
+ --> $DIR/eta.rs:335 :19
139
139
|
140
140
LL | array_opt.map(|a| a.as_slice());
141
141
| ^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `<[u8; 3]>::as_slice`
142
142
143
143
error: redundant closure
144
- --> $DIR/eta.rs:332 :19
144
+ --> $DIR/eta.rs:338 :19
145
145
|
146
146
LL | slice_opt.map(|s| s.len());
147
147
| ^^^^^^^^^^^ help: replace the closure with the method itself: `<[u8]>::len`
148
148
149
149
error: redundant closure
150
- --> $DIR/eta.rs:335 :17
150
+ --> $DIR/eta.rs:341 :17
151
151
|
152
152
LL | ptr_opt.map(|p| p.is_null());
153
153
| ^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `<*const usize>::is_null`
154
154
155
155
error: redundant closure
156
- --> $DIR/eta.rs:339 :17
156
+ --> $DIR/eta.rs:345 :17
157
157
|
158
158
LL | dyn_opt.map(|d| d.method_on_dyn());
159
159
| ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `<dyn TestTrait>::method_on_dyn`
0 commit comments