-
SummaryUpdate my project to 0.7.1 and compile fails with: error[E0107]: trait takes at most 2 generic arguments but 3 generic arguments were supplied
--> src/routes.rs:73:31
|
73 | pub async fn query_user(user: Query<UserQuery>) -> (StatusCode, Json<User>) {
| ^^^^^ expected at most 2 generic arguments
|
note: trait defined here, with at most 2 generic parameters: `S`, `M`
--> /Users/akseli/.cargo/registry/src/index.crates.io-6f17d22bba15001f/axum-core-0.4.0/src/extract/mod.rs:79:11
|
79 | pub trait FromRequest<S, M = private::ViaRequest>: Sized {
| ^^^^^^^^^^^ - -----------------------
help: replace the generic bound with the associated type
|
73 | pub async fn query_user(user: Rejection = Query<UserQuery>) -> (StatusCode, Json<User>) {
| +++++++++++
For more information about this error, try `rustc --explain E0107`. I tried checking the axum examples and documentation but could not figure this out, the examples seem to be using the same syntax 🤷🏻♂️ axum version0.7.1 |
Beta Was this translation helpful? Give feedback.
Answered by
jplatte
Nov 27, 2023
Replies: 1 comment 4 replies
-
Can you please share your |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You are using an incompatible version of
axum
&axum-macros
. It's recommended to not useaxum-macros
directly at all. You can usedebug_handler
as#[axum::debug_handler]
by enabling axum'smacros
Cargo feature (at a slight hit to build parallelism):Alternatively, upgrade
axum-macros
to 0.4.