File tree Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -102,24 +102,16 @@ pub(super) fn check(
102
102
103
103
// We need to provide nonempty parts to diag.multipart_suggestion so we
104
104
// collate all our parts here and then remove those that are empty.
105
- let parts = [
105
+ let mut parts = vec ! [
106
106
(
107
107
receiver. span. to( method_call_span) ,
108
108
format!( "std::iter::{method_to_use_name}" ) ,
109
109
) ,
110
110
new_span,
111
- (
112
- ex. span . shrink_to_hi ( ) ,
113
- if use_take {
114
- format ! ( ".take({count})" )
115
- } else {
116
- String :: new ( )
117
- } ,
118
- ) ,
119
- ]
120
- . into_iter ( )
121
- . filter ( |part| !( part. 0 . is_empty ( ) && part. 1 . is_empty ( ) ) )
122
- . collect ( ) ;
111
+ ] ;
112
+ if use_take {
113
+ parts. push ( ( ex. span . shrink_to_hi ( ) , format ! ( ".take({count})" ) ) ) ;
114
+ }
123
115
124
116
span_lint_and_then (
125
117
cx,
You can’t perform that action at this time.
0 commit comments