askama icon indicating copy to clipboard operation
askama copied to clipboard

askama_rocket 0.11.0-rc.1 seems to be broken

Open jplatte opened this issue 4 years ago • 3 comments

Relevant dependencies:

askama = { version = "0.10.5", features = ["with-rocket"] }
askama_rocket = "0.11.0-rc.1"
rocket = "0.5.0-rc.1"

First template derive that fails:

#[derive(Template)]
#[template(path = "index.html")]
struct IndexTemplate;

Error message:

error[E0107]: this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
   --> src/routes.rs:18:10
    |
18  | #[derive(Template)]
    |          ^^^^^^^^
    |          |
    |          expected 2 lifetime arguments
    |          supplied 1 lifetime argument
    |
note: trait defined here, with 2 lifetime parameters: `'r`, `'o`
   --> /home/jplatte/.cargo/registry/src/github.com-1ecc6299db9ec823/rocket-0.5.0-rc.1/src/response/responder.rs:181:11
    |
181 | pub trait Responder<'r, 'o: 'r> {
    |           ^^^^^^^^^ --  --
    = note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
help: add missing lifetime argument
    |
18  | #[derive(Template, 'askama)]
    |                  ^^^^^^^^^

Full code: https://github.com/jplatte/turbo.fish/compare/askama

jplatte avatar Aug 02 '21 12:08 jplatte

askama_rocket 0.11.0-rc.1 is mismatched with askama_shared 0.10.x. I'll try to publish newer releases for the core crates after #528 lands, and then hopefully you can use askama_rocket 0.11.0-rc.2.

djc avatar Aug 05 '21 11:08 djc

Since #528 was merged is there anything else blocking the release of an rc2? I'm assuming your time is a constraint @djc , not trying to be pushy here just checking to see if I can help with this?

stchris avatar Nov 19 '21 13:11 stchris

So I guess until this gets officially released, we can use it like this, correct?

[dependencies]
askama = { git = "https://github.com/djc/askama.git", rev = "8142963", default-features = false, features = ["with-rocket", "mime", "mime_guess"] }
askama_rocket = { git = "https://github.com/djc/askama.git", rev = "8142963" }

alexfromapex avatar Apr 27 '22 00:04 alexfromapex