This commit is contained in:
Sebastian 2022-10-21 20:05:13 +02:00 committed by GitHub
commit b75e84de2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -29,8 +29,7 @@ use crate::{
/// // {name} - deserialize a String
/// // {count} - deserialize a u32
/// #[get("/{name}/{count}/index.html")]
/// async fn index(path: web::Path<(String, u32)>) -> String {
/// let (name, count) = path.into_inner();
/// async fn index(web::Path((name, count)): web::Path<(String, u32)>) -> String {
/// format!("Welcome {}! {}", name, count)
/// }
/// ```
@ -54,7 +53,7 @@ use crate::{
/// }
/// ```
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Deref, DerefMut, AsRef, Display, From)]
pub struct Path<T>(T);
pub struct Path<T>(pub T);
impl<T> Path<T> {
/// Unwrap into inner `T` value.