mirror of
https://github.com/actix/actix-web.git
synced 2024-11-26 11:31:09 +00:00
fix routes in Path documentation (#2084)
This commit is contained in:
parent
983b6904a7
commit
abcb444dd9
1 changed files with 2 additions and 2 deletions
|
@ -20,7 +20,7 @@ use crate::{dev::Payload, error::PathError, FromRequest, HttpRequest};
|
||||||
/// // extract path info from "/{name}/{count}/index.html" into tuple
|
/// // extract path info from "/{name}/{count}/index.html" into tuple
|
||||||
/// // {name} - deserialize a String
|
/// // {name} - deserialize a String
|
||||||
/// // {count} - deserialize a u32
|
/// // {count} - deserialize a u32
|
||||||
/// #[get("/")]
|
/// #[get("/{name}/{count}/index.html")]
|
||||||
/// async fn index(path: web::Path<(String, u32)>) -> String {
|
/// async fn index(path: web::Path<(String, u32)>) -> String {
|
||||||
/// let (name, count) = path.into_inner();
|
/// let (name, count) = path.into_inner();
|
||||||
/// format!("Welcome {}! {}", name, count)
|
/// format!("Welcome {}! {}", name, count)
|
||||||
|
@ -40,7 +40,7 @@ use crate::{dev::Payload, error::PathError, FromRequest, HttpRequest};
|
||||||
/// }
|
/// }
|
||||||
///
|
///
|
||||||
/// // extract `Info` from a path using serde
|
/// // extract `Info` from a path using serde
|
||||||
/// #[get("/")]
|
/// #[get("/{name}")]
|
||||||
/// async fn index(info: web::Path<Info>) -> String {
|
/// async fn index(info: web::Path<Info>) -> String {
|
||||||
/// format!("Welcome {}!", info.name)
|
/// format!("Welcome {}!", info.name)
|
||||||
/// }
|
/// }
|
||||||
|
|
Loading…
Reference in a new issue