Context: cargo fmt had a blast
@@ -80,8 +80,7 @@ impl<Env: Environment + 'static> Update for Ctx<Env> {
// CtxUpdate - should call save_storage
// push addons - Event::CtxPushedAddons
// pull addons - the result of that, Internal::CtxPulledAddons, should be handled and produces Event::CtxPulledAddons(is_new)
- Msg::Action(Action::UserOp(user_op)) => {
- match user_op.to_owned() {
+ Msg::Action(Action::UserOp(user_op)) => match user_op.to_owned() {
ActionUser::Logout => {
let new_content = Box::new(CtxContent::default());
match &self.content.auth {
@@ -109,11 +108,8 @@ impl<Env: Environment + 'static> Update for Ctx<Env> {
APIRequest::Login { email, password },
))
.unchanged(),
- ActionUser::PullAddons => {
- Effects::none().unchanged()
- },
- ActionUser::PushAddons => {
- match &self.content.auth {
+ ActionUser::PullAddons => Effects::none().unchanged(),
+ ActionUser::PushAddons => match &self.content.auth {
Some(Auth { key, .. }) => {
let user_op = user_op.to_owned();
let req = APIRequest::AddonCollectionSet {
@@ -125,11 +121,9 @@ impl<Env: Environment + 'static> Update for Ctx<Env> {
.map_err(move |e| UserOpError(user_op, e.into()).into());
Effects::one(Box::new(ft)).unchanged()
}
- None => Effects::none().unchanged()
- }
- }
- }
- }
+ None => Effects::none().unchanged(),
+ },
+ },
Msg::Internal(CtxUpdate(new)) => {
// @TODO this is the place to check for changed add-ons/auth and emit the
// corresponding events
