1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-06-25 18:09:22 +02:00

update examples

This commit is contained in:
Nikolay Kim
2018-02-12 19:15:39 -08:00
parent 80285f2a32
commit eb041de36d
5 changed files with 9 additions and 8 deletions

View File

@ -31,14 +31,14 @@ use db::{CreateUser, DbExecutor};
/// State with DbExecutor address
struct State {
db: Addr<Syn<DbExecutor>>,
db: Addr<Syn, DbExecutor>,
}
/// Async request handler
fn index(req: HttpRequest<State>) -> Box<Future<Item=HttpResponse, Error=Error>> {
let name = &req.match_info()["name"];
req.state().db.call_fut(CreateUser{name: name.to_owned()})
req.state().db.call(CreateUser{name: name.to_owned()})
.from_err()
.and_then(|res| {
match res {