You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I managed to reproduce this issue within askama_axum:
-axum = { version = "0.7", default-features = false }
+axum = { version = "0.8", default-features = false }
❯ cargo test Compiling askama_axum v0.5.0 (/home/vac/Downloads/askama/askama_axum)error[E0277]: the trait bound `fn() -> impl Future<Output = HelloTemplate<'static>> {hello}: Handler<_, _>` is not satisfied --> askama_axum/tests/basic.rs:23:44 |23 | let app = Router::new().route("/", get(hello)); | --- ^^^^^ the trait `Handler<_, _>` is not implemented for fn item `fn() -> impl Future<Output = HelloTemplate<'static>> {hello}` | | | required by a bound introduced by this call | = note: Consider using `#[axum::debug_handler]` to improve the error message = help: the following other types implement trait `Handler<T, S>`: `Layered<L, H, T, S>` implements `Handler<T, S>` `MethodRouter<S>` implements `Handler<(), S>`note: required by a bound in `axum::routing::get` --> /home/vac/.cargo/registry/src/mirrors.ustc.edu.cn-4affec411d11e50f/axum-0.8.0/src/routing/method_routing.rs:440:1 |440 | top_level_handler_fn!(get, GET); | ^^^^^^^^^^^^^^^^^^^^^^---^^^^^^ | | | | | required by a bound in this function | required by this bound in `get` = note: this error originates in the macro `top_level_handler_fn` (in Nightly builds, run with -Z macro-backtrace for more info)For more information about this error, try `rustc --explain E0277`.error: could not compile `askama_axum` (test "basic") due to 1 previous error
And bump the version of axum-core seems enough for this issue:
Would it be possible to get this released as a patch for 0.12? Askama is now blocking all our renovate-bot PRs that uses axum and askama together, since askama can't build with axum 0.8
I just published askama-derive-axum, which implements an IntoResponse derive macro which replaces the askama_axum crate which is slated for deprecation. It currently works with Askama 0.12 and axum-core 0.5 (aka axum 0.8).
use askama::Template;use askama_derive_axum::IntoResponse;#[derive(Template,IntoResponse)]#[template(path = "index.html")]structIndexTemplate{title:String,body:String,}asyncfnindex() -> IndexTemplate{IndexTemplate{title:"My Blog".to_string(),body:"Hello, world!".to_string(),}}
I tried to upgrade axum from 0.7.9 to 0.8.0, but it seems that the breaking changes introduced by axum also break askama_axum 0.5.
I managed to reproduce this issue within askama_axum:
And bump the version of axum-core seems enough for this issue:
The text was updated successfully, but these errors were encountered: