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

I can't compile the code, it prompts a compilation error, could you help me? #1

Open
eyes4 opened this issue Nov 16, 2023 · 1 comment

Comments

@eyes4
Copy link

eyes4 commented Nov 16, 2023

When compiling the program, it prompts:
error[E0277]: the trait bound fn(axum::extract::State<Arc<AppState>>, axum::Json<RegisterUserSchema>) -> impl std::future::Future<Output = Result<impl IntoResponse, (axum::http::StatusCode, axum::Json<JsonValue>)>> {register_user_handler}: Handler<_, _, _> is not satisfied
--> src/route.rs:21:43
|
21 | .route("/api/auth/register", post(register_user_handler))
| ---- ^^^^^^^^^^^^^^^^^^^^^ the trait Handler<_, _, _> is not implemented for fn item fn(axum::extract::State<Arc<AppState>>, axum::Json<RegisterUserSchema>) -> impl std::future::Future<Output = Result<impl IntoResponse, (axum::http::StatusCode, axum::Json<JsonValue>)>> {register_user_handler}
| |
| required by a bound introduced by this call
|
= help: the following other types implement trait Handler<T, S, B>:
<Or<L, R, Lt, Rt, S, B> as Handler<(M, Lt, Rt), S, B>>
<IntoHandler<H, T, S, B> as Handler<T, S, B>>
<Layered<L, H, T, S, B, B2> as Handler<T, S, B2>>
<MethodRouter<S, B> as Handler<(), S, B>>

@henningcullin
Copy link

have you tried changing impl IntoResponse to UserResponse?

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

No branches or pull requests

2 participants