From 8a3a1f2eecf575fba5628e798cd7ed0472a4c6f7 Mon Sep 17 00:00:00 2001 From: "Iria.Somobu" Date: Thu, 27 Feb 2025 16:27:21 +0300 Subject: [PATCH] Make web::Path innards public So we can do something like this: ``` async fn delete_channel_message( web::Path((channel_id, message_id)): web::Path<(Snowflake, Snowflake)>, ) { // here channel_id and message_id are Snowflakes, // and not web::Path } ``` Dunno why other web types are public and this is not. --- actix-web/CHANGES.md | 2 ++ actix-web/src/types/path.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/actix-web/CHANGES.md b/actix-web/CHANGES.md index 588320f4..6f9588b6 100644 --- a/actix-web/CHANGES.md +++ b/actix-web/CHANGES.md @@ -2,6 +2,8 @@ ## Unreleased +- Make contents of `web::Path` public. + ## 4.9.0 ### Added diff --git a/actix-web/src/types/path.rs b/actix-web/src/types/path.rs index cc87bb80..3a1fe8cf 100644 --- a/actix-web/src/types/path.rs +++ b/actix-web/src/types/path.rs @@ -54,7 +54,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.