`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:
Austin Bonander 2021-04-13 11:39:38 -07:00 committed by GitHub
parent 02ced426fd
commit 22fb37142f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -46,7 +46,7 @@ use crate::{dev::Payload, error::PathError, FromRequest, HttpRequest};
/// }
/// ```
#[derive(PartialEq, Eq, PartialOrd, Ord, Debug)]
pub struct Path<T>(T);
pub struct Path<T>(pub T);
impl<T> Path<T> {
/// Unwrap into inner `T` value.