middlewares/user: shadow action
@@ -27,9 +27,9 @@ impl<T: Environment> Handler for UserMiddleware<T> {
Action::Init => {}
_ => return,
}
- let action_owned = action.to_owned();
+ let action = action.to_owned();
// @TODO find a way to implicitly unwrap the .result field
- // something like APIWrapper
+ // @TODO APIWrapper, err handling
#[derive(Serialize,Clone)]
struct APICollectionRequest {};
#[derive(Serialize,Deserialize)]
@@ -45,7 +45,7 @@ impl<T: Environment> Handler for UserMiddleware<T> {
let addons = &r.result.addons;
// @TODO Should we have an Into Box on action, so we can write this
// as .clone().into() ?
- emit(&Action::WithAddons(addons.to_vec(), Box::new(action_owned)));
+ emit(&Action::WithAddons(addons.to_vec(), Box::new(action)));
future::ok(())
})
// @TODO handle the error
