-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make web::Path innards public #3588
base: master
Are you sure you want to change the base?
Conversation
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<Snowflake> } ``` Dunno why other web types are public and this is not.
This field was made private for v4.0 but later it was realized this was the wrong trade-off. Making it public again is certainly planned for v5.0. This is a breaking change due to the Deref impl, so it should also be removed in this PR. For now, you can use the Path type from actix-web-lab to get destructuring. |
Could you elaborate please? |
The thing we were seeing in v3.x was users reporting confusion using this type without destructuring because the Deref impl allowed access to tuple elements like |
Okey, I get it. |
No rush. Like I say, this will need to wait for v5.0. |
@robjtede: Deref impl [with public Path contents] allowed access to tuple elements like path.1 but then path.0.1 also worked so it was weird.
PR Type
Other?
PR Checklist
Documentation comments have been added / updatedOverview
This change allows us to do something like this:
Dunno why other web types are public and this is not.