janitor: Simplify x.map(f).flatten() to x.flat_map(f)

This commit is contained in:
Tobias Hunger 2022-01-04 09:33:51 +01:00
parent 4e227684ea
commit 8d799fe78d
No known key found for this signature in database
GPG key ID: 60874021D2F23F91

View file

@ -1125,14 +1125,13 @@ pub fn instantiate(
extra_data.globals = component_type
.compiled_globals
.iter()
.map(|g| {
.flat_map(|g| {
let (_, instance) = crate::global_component::instantiate(g);
g.names()
.iter()
.map(|name| (crate::normalize_identifier(name).to_string(), instance.clone()))
.collect::<Vec<_>>()
})
.flatten()
.collect();
extra_data.embedded_file_resources = component_type