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
Hi, consider this as much a question as an issue report. I am quite new to the Rust ecosystem, so forgive me if this comes across as a tad ignorant. The documentation for the Axum integration states:
However, when I have both askama and askama_axum installed, I can also use the 'regular' askama::Template without getting any compilation issues. For example:
Is this intended to work as such, and is it ok to keep using it like this? Why would one need to use asaka_axum and what extra does it do on top of the regular template?
I am also interested in how Cargo manages dependencies. If I install askama_axum I can see that askama is listed as a dependency, so I would expect that if I list askama_axum as the only dependency in Cargo.toml, it would also bring axum along.
However, if I modify the code above to use askama_axum::Template as the documentation states, and only install askama_axum, then I get the following compilation error:
error[E0433]: failed to resolve: could not find `askama` in the list of imported crates
--> src/main.rs:14:10
|
14 | #[derive(Template)]
| ^^^^^^^^ could not find `askama` in the list of imported crates
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
This is strange because Template is imported from askama_axum and not askama. But it leads me to believe that I need to have both askama_axum and askama listed in Cargo.toml, even though my code does not directly depend on askama. Is this intentional behavior? Should I be listing both? If so, why is askama not pulled in with askama_axum?
Again, total novice here. Feel free to close this issue if it's too much of a hassle to answer. Thanks in advance.
The text was updated successfully, but these errors were encountered:
@djc: Is it another issue with "the askama book is the not yet released version?". If so we should have a "nightly" and "stable" link for both, what do you think?
@djc: Is it another issue with "the askama book is the not yet released version?". If so we should have a "nightly" and "stable" link for both, what do you think?
IIRC someone tried this and it introduced a lot of complexity (there's probably a closed PR somewhere), which I didn't like. If there's an efficient way (in terms of added code/complexity) to do it, would be okay -- but also this kind of disparity is pretty rare and it's not like we get a zillion issues from it.
Hi, consider this as much a question as an issue report. I am quite new to the Rust ecosystem, so forgive me if this comes across as a tad ignorant. The documentation for the Axum integration states:
However, when I have both
askama
andaskama_axum
installed, I can also use the 'regular'askama::Template
without getting any compilation issues. For example:Is this intended to work as such, and is it ok to keep using it like this? Why would one need to use
asaka_axum
and what extra does it do on top of the regular template?I am also interested in how Cargo manages dependencies. If I install
askama_axum
I can see thataskama
is listed as a dependency, so I would expect that if I listaskama_axum
as the only dependency inCargo.toml
, it would also bringaxum
along.However, if I modify the code above to use
askama_axum::Template
as the documentation states, and only installaskama_axum
, then I get the following compilation error:This is strange because
Template
is imported fromaskama_axum
and notaskama
. But it leads me to believe that I need to have bothaskama_axum
andaskama
listed inCargo.toml
, even though my code does not directly depend onaskama
. Is this intentional behavior? Should I be listing both? If so, why isaskama
not pulled in withaskama_axum
?Again, total novice here. Feel free to close this issue if it's too much of a hassle to answer. Thanks in advance.
The text was updated successfully, but these errors were encountered: