Skip to content

Commit b57d17b

Browse files
committed
Simplification suggested by Claude
1 parent a8fdba4 commit b57d17b

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

dylint/src/lib.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -266,15 +266,13 @@ where
266266
for<'a> &'a I: IntoIterator<Item = &'a T>,
267267
T: Clone,
268268
{
269-
toolchain_map
270-
.iter()
271-
.flat_map(|(toolchain, values)| {
272-
values
273-
.into_iter()
274-
.map(|value| (toolchain.clone(), value.clone()))
275-
.collect::<Vec<_>>()
276-
})
277-
.collect()
269+
let mut result = Vec::new();
270+
for (toolchain, values) in toolchain_map {
271+
for value in values {
272+
result.push((toolchain.clone(), value.clone()));
273+
}
274+
}
275+
result
278276
}
279277

280278
fn name_as_path(name: &str, as_path_only: bool) -> Result<Option<(String, PathBuf)>> {

0 commit comments

Comments
 (0)