mirror of
https://github.com/actix/actix-extras.git
synced 2025-02-21 18:12:47 +01:00
fix examples
This commit is contained in:
parent
cc38b30f7b
commit
8e89ff1d1e
@ -42,7 +42,7 @@ fn index(req: HttpRequest<State>) -> Box<Future<Item=HttpResponse, Error=Error>>
|
|||||||
.and_then(|res| {
|
.and_then(|res| {
|
||||||
match res {
|
match res {
|
||||||
Ok(user) => Ok(httpcodes::HTTPOk.build().json(user)?),
|
Ok(user) => Ok(httpcodes::HTTPOk.build().json(user)?),
|
||||||
Err(_) => Ok(httpcodes::HTTPInternalServerError.response())
|
Err(_) => Ok(httpcodes::HTTPInternalServerError.into())
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.responder()
|
.responder()
|
||||||
|
@ -39,7 +39,7 @@ fn index(mut req: HttpRequest) -> Box<Future<Item=HttpResponse, Error=Error>>
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.finish() // <- Stream::finish() combinator from actix
|
.finish() // <- Stream::finish() combinator from actix
|
||||||
.map(|_| httpcodes::HTTPOk.response())
|
.map(|_| httpcodes::HTTPOk.into())
|
||||||
.responder()
|
.responder()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user