diff --git a/actix-web/src/types/path.rs b/actix-web/src/types/path.rs index a90c912f6..8da8dcbde 100644 --- a/actix-web/src/types/path.rs +++ b/actix-web/src/types/path.rs @@ -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); +pub struct Path(pub T); impl Path { /// Unwrap into inner `T` value.