1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-25 06:39:22 +02:00

better handler function ergonimics

This commit is contained in:
Nikolay Kim
2017-10-29 21:39:59 -07:00
parent 8aa20c6261
commit 4e216701c0
6 changed files with 25 additions and 15 deletions

View File

@ -16,7 +16,7 @@ fn create_server<T, A>() -> HttpServer<T, A, Application<()>> {
vec![Application::default("/")
.resource("/", |r|
r.handler(Method::GET, |_, _, _| {
httpcodes::HTTPOk
Ok(httpcodes::HTTPOk)
}))
.finish()])
}
@ -96,7 +96,7 @@ fn test_middlewares() {
finish: act_num3})
.resource("/", |r|
r.handler(Method::GET, |_, _, _| {
httpcodes::HTTPOk
Ok(httpcodes::HTTPOk)
}))
.finish()])
.serve::<_, ()>("127.0.0.1:58904").unwrap();