diff --git a/src/handler.rs b/src/handler.rs index 7b88248bf..a10a6f9c9 100644 --- a/src/handler.rs +++ b/src/handler.rs @@ -492,14 +492,15 @@ where /// } /// /// /// extract path info using serde -/// fn index(state: State, info: Path) -> String { -/// format!("{} {}!", state.msg, info.username) +/// fn index(data: (State, Path)) -> String { +/// let (state, path) = data; +/// format!("{} {}!", state.msg, path.username) /// } /// /// fn main() { /// let app = App::with_state(MyApp{msg: "Welcome"}).resource( /// "/{username}/index.html", // <- define path parameters -/// |r| r.method(http::Method::GET).with2(index)); // <- use `with` extractor +/// |r| r.method(http::Method::GET).with(index)); // <- use `with` extractor /// } /// ``` pub struct State(HttpRequest);