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:
parent
dcc5eb7ace
commit
29a0feb415
1 changed files with 1 additions and 2 deletions
|
@ -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))
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue