1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-11-26 19:41:12 +00:00

fix guide example

This commit is contained in:
Nikolay Kim 2018-03-27 07:47:29 -07:00
parent dcc5eb7ace
commit 29a0feb415

View file

@ -337,7 +337,6 @@ from *serde* libary.
# extern crate futures;
#[macro_use] extern crate serde_derive;
use actix_web::*;
use actix_web::dev::{Path, HttpRequestExtractor};
#[derive(Deserialize)]
struct Info {
@ -345,7 +344,7 @@ struct Info {
}
fn index(mut req: HttpRequest) -> Result<String> {
let info: Info = Path.extract(&req)?; // <- extract path info using serde
let info: Info = req.extract_path()?; // <- extract path info using serde
Ok(format!("Welcome {}!", info.username))
}