mirror of https://github.com/fafhrd91/actix-web
`Path`: make content field `pub` again
Upgrading to the beta and this seems to have changed from `3.3.5` but no reason is given in #1894 for the change so I presume it was a mistake. The content field of `Json` is still `pub` which supports this conclusion. I recently switched from calling `.into_inner()` to destructuring in the function arguments and it's a lot nicer, especially for singular path arguments such as: ```rust #[get("/user/{id}")] async fn get_user(Path(user_id): Path<Uuid>) -> Option<User> { // ... } ```
This commit is contained in:
parent
02ced426fd
commit
22fb37142f
|
@ -46,7 +46,7 @@ use crate::{dev::Payload, error::PathError, FromRequest, HttpRequest};
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(PartialEq, Eq, PartialOrd, Ord, Debug)]
|
#[derive(PartialEq, Eq, PartialOrd, Ord, Debug)]
|
||||||
pub struct Path<T>(T);
|
pub struct Path<T>(pub T);
|
||||||
|
|
||||||
impl<T> Path<T> {
|
impl<T> Path<T> {
|
||||||
/// Unwrap into inner `T` value.
|
/// Unwrap into inner `T` value.
|
||||||
|
|
Loading…
Reference in New Issue