refactor MetaDetails for readability
@@ -24,7 +24,6 @@ impl<Env: Environment + 'static> UpdateWithCtx<Ctx<Env>> for MetaDetails {
&AggrRequest::AllOfResource(metas_resource_ref),
);
self.metas = metas;
- self.streams = Vec::new();
if let Some(video_id) = video_id {
let streams_resource_ref =
ResourceRef::without_extra("stream", type_name, video_id);
@@ -33,10 +32,12 @@ impl<Env: Environment + 'static> UpdateWithCtx<Ctx<Env>> for MetaDetails {
&AggrRequest::AllOfResource(streams_resource_ref),
);
self.streams = streams;
- return metas_effects.join(streams_effects);
- }
+ metas_effects.join(streams_effects)
+ } else {
+ self.streams = Vec::new();
metas_effects
}
+ }
_ => addon_aggr_update(&mut self.metas, msg)
.join(addon_aggr_update(&mut self.streams, msg)),
}
