Skip to content

Supporting routes with single and double arguments. #2898

Answered by robjtede
madelaney asked this question in Q&A
Discussion options

You must be logged in to vote

The only mistake you made in the OP was declaring multiple Path parameters in the update_to_action handler.

This will try to extract one path param twice:

    name: web::Path<String>,
    uuid: web::Path<String>,

This, using a tuple type, will extract two path params.

    params: web::Path<(String, String)>,

See the full solution here: https://www.rustexplorer.com/b/cfykzk
(Uses a slightly nicer type from actix-web-lab that can be destructured, too.)

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@madelaney
Comment options

Answer selected by madelaney
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants