mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-28 01:32:57 +01:00
fix guide example
This commit is contained in:
parent
dcc5eb7ace
commit
29a0feb415
@ -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 New Issue
Block a user