middlewares/catalog: use functional style for viable catalogs
@@ -37,14 +37,12 @@ impl<T: Environment> Handler for CatalogMiddleware<T> {
// @TODO we might need is_catalog_supported
// https://github.com/Stremio/stremio-aggregators/blob/master/lib/isCatalogSupported.js
for addon in addons.iter() {
- let viable_catalogs = addon
+ addon
.manifest
.catalogs
.iter()
- .filter(|cat| cat.extra_required.is_empty());
- for cat in viable_catalogs {
- self.for_catalog(addon, cat, emit.clone());
- }
+ .filter(|cat| cat.extra_required.is_empty())
+ .for_each(|cat| self.for_catalog(addon, cat, emit.clone()));
}
}
}
