From 22fb37142f99db65a95a00a763363c0bc53c3170 Mon Sep 17 00:00:00 2001 From: Austin Bonander Date: Tue, 13 Apr 2021 11:39:38 -0700 Subject: [PATCH] `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) -> Option { // ... } ``` --- src/types/path.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types/path.rs b/src/types/path.rs index 50e2cb510..6d73911d0 100644 --- a/src/types/path.rs +++ b/src/types/path.rs @@ -46,7 +46,7 @@ use crate::{dev::Payload, error::PathError, FromRequest, HttpRequest}; /// } /// ``` #[derive(PartialEq, Eq, PartialOrd, Ord, Debug)] -pub struct Path(T); +pub struct Path(pub T); impl Path { /// Unwrap into inner `T` value.