1
0
mirror of https://github.com/actix/examples synced 2025-06-28 18:00:37 +02:00

do not use with2

This commit is contained in:
Nikolay Kim
2018-06-01 11:31:53 -07:00
parent 32287e37bc
commit 96a77890ba
6 changed files with 36 additions and 15 deletions

View File

@ -15,7 +15,7 @@ struct AppState {
}
fn index(
state: State<AppState>, query: Query<HashMap<String, String>>,
(state, query): (State<AppState>, Query<HashMap<String, String>>),
) -> Result<HttpResponse, Error> {
let s = if let Some(name) = query.get("name") {
// <- submitted form
@ -47,7 +47,7 @@ fn main() {
App::with_state(AppState{template: tera})
// enable logger
.middleware(middleware::Logger::default())
.resource("/", |r| r.method(http::Method::GET).with2(index))
.resource("/", |r| r.method(http::Method::GET).with(index))
}).bind("127.0.0.1:8080")
.unwrap()
.start();