@@ -31,129 +31,129 @@ LL | let e = Some(1u8).map(|a| generic(a));
3131 | ^^^^^^^^^^^^^^ help: replace the closure with the function itself: `generic`
3232
3333error: redundant closure
34- --> $DIR/eta.rs:87 :51
34+ --> $DIR/eta.rs:93 :51
3535 |
3636LL | let e = Some(TestStruct { some_ref: &i }).map(|a| a.foo());
3737 | ^^^^^^^^^^^ help: replace the closure with the method itself: `TestStruct::foo`
3838 |
3939 = note: `-D clippy::redundant-closure-for-method-calls` implied by `-D warnings`
4040
4141error: redundant closure
42- --> $DIR/eta.rs:88 :51
42+ --> $DIR/eta.rs:94 :51
4343 |
4444LL | let e = Some(TestStruct { some_ref: &i }).map(|a| a.trait_foo());
4545 | ^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `TestTrait::trait_foo`
4646
4747error: redundant closure
48- --> $DIR/eta.rs:90 :42
48+ --> $DIR/eta.rs:96 :42
4949 |
5050LL | let e = Some(&mut vec![1, 2, 3]).map(|v| v.clear());
5151 | ^^^^^^^^^^^^^ help: replace the closure with the method itself: `std::vec::Vec::clear`
5252
5353error: redundant closure
54- --> $DIR/eta.rs:94 :29
54+ --> $DIR/eta.rs:100 :29
5555 |
5656LL | let e = Some("str").map(|s| s.to_string());
5757 | ^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `std::string::ToString::to_string`
5858
5959error: redundant closure
60- --> $DIR/eta.rs:95 :27
60+ --> $DIR/eta.rs:101 :27
6161 |
6262LL | let e = Some('a').map(|s| s.to_uppercase());
6363 | ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `char::to_uppercase`
6464
6565error: redundant closure
66- --> $DIR/eta.rs:97 :65
66+ --> $DIR/eta.rs:103 :65
6767 |
6868LL | let e: std::vec::Vec<char> = vec!['a', 'b', 'c'].iter().map(|c| c.to_ascii_uppercase()).collect();
6969 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `char::to_ascii_uppercase`
7070
7171error: redundant closure
72- --> $DIR/eta.rs:160 :22
72+ --> $DIR/eta.rs:166 :22
7373 |
7474LL | requires_fn_once(|| x());
7575 | ^^^^^^ help: replace the closure with the function itself: `x`
7676
7777error: redundant closure
78- --> $DIR/eta.rs:167 :27
78+ --> $DIR/eta.rs:173 :27
7979 |
8080LL | let a = Some(1u8).map(|a| foo_ptr(a));
8181 | ^^^^^^^^^^^^^^ help: replace the closure with the function itself: `foo_ptr`
8282
8383error: redundant closure
84- --> $DIR/eta.rs:172 :27
84+ --> $DIR/eta.rs:178 :27
8585 |
8686LL | let a = Some(1u8).map(|a| closure(a));
8787 | ^^^^^^^^^^^^^^ help: replace the closure with the function itself: `closure`
8888
8989error: redundant closure
90- --> $DIR/eta.rs:204 :28
90+ --> $DIR/eta.rs:210 :28
9191 |
9292LL | x.into_iter().for_each(|x| add_to_res(x));
9393 | ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `&mut add_to_res`
9494
9595error: redundant closure
96- --> $DIR/eta.rs:205 :28
96+ --> $DIR/eta.rs:211 :28
9797 |
9898LL | y.into_iter().for_each(|x| add_to_res(x));
9999 | ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `&mut add_to_res`
100100
101101error: redundant closure
102- --> $DIR/eta.rs:206 :28
102+ --> $DIR/eta.rs:212 :28
103103 |
104104LL | z.into_iter().for_each(|x| add_to_res(x));
105105 | ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `add_to_res`
106106
107107error: redundant closure
108- --> $DIR/eta.rs:213 :21
108+ --> $DIR/eta.rs:219 :21
109109 |
110110LL | Some(1).map(|n| closure(n));
111111 | ^^^^^^^^^^^^^^ help: replace the closure with the function itself: `&mut closure`
112112
113113error: redundant closure
114- --> $DIR/eta.rs:217 :21
114+ --> $DIR/eta.rs:223 :21
115115 |
116116LL | Some(1).map(|n| in_loop(n));
117117 | ^^^^^^^^^^^^^^ help: replace the closure with the function itself: `in_loop`
118118
119119error: redundant closure
120- --> $DIR/eta.rs:310 :18
120+ --> $DIR/eta.rs:316 :18
121121 |
122122LL | takes_fn_mut(|| f());
123123 | ^^^^^^ help: replace the closure with the function itself: `&mut f`
124124
125125error: redundant closure
126- --> $DIR/eta.rs:313 :19
126+ --> $DIR/eta.rs:319 :19
127127 |
128128LL | takes_fn_once(|| f());
129129 | ^^^^^^ help: replace the closure with the function itself: `&mut f`
130130
131131error: redundant closure
132- --> $DIR/eta.rs:317 :26
132+ --> $DIR/eta.rs:323 :26
133133 |
134134LL | move || takes_fn_mut(|| f_used_once())
135135 | ^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `&mut f_used_once`
136136
137137error: redundant closure
138- --> $DIR/eta.rs:329 :19
138+ --> $DIR/eta.rs:335 :19
139139 |
140140LL | array_opt.map(|a| a.as_slice());
141141 | ^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `<[u8; 3]>::as_slice`
142142
143143error: redundant closure
144- --> $DIR/eta.rs:332 :19
144+ --> $DIR/eta.rs:338 :19
145145 |
146146LL | slice_opt.map(|s| s.len());
147147 | ^^^^^^^^^^^ help: replace the closure with the method itself: `<[u8]>::len`
148148
149149error: redundant closure
150- --> $DIR/eta.rs:335 :17
150+ --> $DIR/eta.rs:341 :17
151151 |
152152LL | ptr_opt.map(|p| p.is_null());
153153 | ^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `<*const usize>::is_null`
154154
155155error: redundant closure
156- --> $DIR/eta.rs:339 :17
156+ --> $DIR/eta.rs:345 :17
157157 |
158158LL | dyn_opt.map(|d| d.method_on_dyn());
159159 | ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `<dyn TestTrait>::method_on_dyn`
0 commit comments