Use flatten instead of flat_map

This commit is contained in:
2022-06-13 11:37:56 +02:00
parent de4b324651
commit 82e7b22443
2 changed files with 4 additions and 4 deletions

View File

@@ -127,8 +127,8 @@ impl Batch {
) { ) {
let this_agent = composition let this_agent = composition
.iter() .iter()
.flat_map(|teams| teams.iter()) .flatten()
.flat_map(|team| team.iter()) .flatten()
.cloned() .cloned()
.collect::<HashSet<_>>(); .collect::<HashSet<_>>();

View File

@@ -27,8 +27,8 @@ impl History {
) -> Self { ) -> Self {
let this_agent = composition let this_agent = composition
.iter() .iter()
.flat_map(|teams| teams.iter()) .flatten()
.flat_map(|team| team.iter()) .flatten()
.cloned() .cloned()
.collect::<HashSet<_>>(); .collect::<HashSet<_>>();