Skip to content
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

in 4.0.0-beta.3: expected tuple struct or tuple variant, found struct web::Path #2038

Closed
rich-murphey opened this issue Mar 1, 2021 · 1 comment

Comments

@rich-murphey
Copy link

Expected Behavior

Migration.md says this should work:

// Or (this wasn't previously supported):
async fn some_route(web::Path((first_name, last_name)): web::Path<(String, String)>) -> String {
  format!("Hello, {} {}", first_name, last_name)
}

Current Behavior

error[E0532]: expected tuple struct or tuple variant, found struct `web::Path`
   |
73 | async fn test(web::Path((first_name, last_name)): web::Path<(String, String)>) -> String {
   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use struct pattern syntax instead: `web::Path { 0 }`
   |
  ::: ..../actix-web-4.0.0-beta.3/src/types/path.rs:49:1
   |
49 | pub struct Path<T>(T);
   | ---------------------- `web::Path` defined here
error: aborting due to previous error

Possible Solution

I don't know. I'm pretty sure I've used this in previous versions, so I'm guessing it's possible.
I haven't researched it yet, so I could be wrong.

Steps to Reproduce (for bugs)

compile the above function.

Context

I'm trying to do exactly what the above function does.

Your Environment

Ubuntu 20.04

  • Rust Version (I.e, output of rustc -V): rustc 1.50.0 (cb75ad5db 2021-02-10)
  • Actix Web Version: "4.0.0-beta.3"
@robjtede
Copy link
Member

robjtede commented Mar 1, 2021

Duplicate of #2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants