We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a59390 commit 3e199e9Copy full SHA for 3e199e9
clippy_lints/src/methods/map_with_unused_argument_over_ranges.rs
@@ -102,24 +102,16 @@ pub(super) fn check(
102
103
// We need to provide nonempty parts to diag.multipart_suggestion so we
104
// collate all our parts here and then remove those that are empty.
105
- let parts = [
+ let mut parts = vec![
106
(
107
receiver.span.to(method_call_span),
108
format!("std::iter::{method_to_use_name}"),
109
),
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();
+ ];
+ if use_take {
+ parts.push((ex.span.shrink_to_hi(), format!(".take({count})")));
+ }
123
124
span_lint_and_then(
125
cx,
0 commit comments