catalogs: more readable
@@ -191,10 +191,11 @@ impl Container for Streams {
.iter()
.map(|req| (req.to_owned(), Loadable::Loading))
.collect();
- return Some(Box::new(Streams { groups }));
- }
+ Some(Box::new(Streams { groups }))
+ } else {
None
}
+ }
Msg::Internal(AddonResponse(req, result)) => {
if let Some(idx) = self.groups.iter().position(|g| &g.0 == req) {
let mut groups = self.groups.to_owned();
@@ -204,10 +205,11 @@ impl Container for Streams {
ResourceResponse::Streams { streams },
streams.to_owned()
);
- return Some(Box::new(Streams { groups }));
- }
+ Some(Box::new(Streams { groups }))
+ } else {
None
}
+ }
_ => None,
}
}
