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(
102102
103103 // We need to provide nonempty parts to diag.multipart_suggestion so we
104104 // collate all our parts here and then remove those that are empty.
105- let parts = [
105+ let mut parts = vec ! [
106106 (
107107 receiver. span. to( method_call_span) ,
108108 format!( "std::iter::{method_to_use_name}" ) ,
109109 ) ,
110110 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+ }
123115
124116 span_lint_and_then (
125117 cx,
You can’t perform that action at this time.
0 commit comments