From 487a713ca0b29e07b13fef45984927e9f279eb88 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Fri, 11 May 2018 15:01:15 -0700 Subject: [PATCH] update doc string --- src/handler.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/handler.rs b/src/handler.rs index 7b88248bf2a..a10a6f9c9d4 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);