1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-30 18:34:36 +01: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; # extern crate futures;
#[macro_use] extern crate serde_derive; #[macro_use] extern crate serde_derive;
use actix_web::*; use actix_web::*;
use actix_web::dev::{Path, HttpRequestExtractor};
#[derive(Deserialize)] #[derive(Deserialize)]
struct Info { struct Info {
@ -345,7 +344,7 @@ struct Info {
} }
fn index(mut req: HttpRequest) -> Result<String> { 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)) Ok(format!("Welcome {}!", info.username))
} }