This PR
* removes the crate `askama_derive_standalone`,
* makes `askama_derive` a normal library, and
* adds the proc-macro crate `askama_macros`,
Before, it was not possible for another crate to re-export
`askama::Template` in a useful way, because the generated code assumes
that it has access to an `extern crate askama`.
`askama_derive` will export the function `derive_template()` like
`askama_derive_standalone` did, but it has an additional argument to
accept a `TokenStream` that should contain (an) statement(s) to define
the identifier `askama`, e.g. `quote! { extern crate askama; }`.
The new proc-macro crate `askama_macros` now defines the derive-macro
`Template` by calling `askama_derive::derive_template()`.
Prior art: [`encase`] → [`encase_derive`] → [`encase_derive_impl`];
[2298a3e].
[`encase`]: <https://crates.io/crates/encase/0.11.0>
[`encase_derive`]: <https://crates.io/crates/encase_derive/0.11.0>
[`encase_derive_impl`]: <https://crates.io/crates/encase_derive_impl/0.11.0>
[2298a3e]: <2298a3efd5>
Github's language statistics for the project say that 43% of askama is
assembly code. It is not. The heuristic counts our fuzzing corpus as
assembly code, and the corpus is quite big.
This PR excludes the corpus from being counted.
* Add test to ensure `Cow<'_, str>` implements `FastWritable`
* Relax Sized constraint on `impl FastWritable for Cow`
* Run rustfmt
Signed-off-by: C0D3 M4513R <28912031+C0D3-M4513R@users.noreply.github.com>
* Put "test" in a const block.
* Update cow_str_implements_fast_writable.rs
Co-authored-by: René Kijewski <Kijewski@users.noreply.github.com>
---------
Signed-off-by: C0D3 M4513R <28912031+C0D3-M4513R@users.noreply.github.com>
Co-authored-by: René Kijewski <Kijewski@users.noreply.github.com>
It was a small script to test common Github action config errors, but
IMHO it became more opinionated with every release. No, I won't add a
hashsum to every `uses` line, thank you for asking again and again.
Also, it takes 3 minutes to build by now. 3 minutes until the first real
test is executed.
The generated `TokenStream` gets parsed correctly by `rustc`, but fails
to be parsed by `syn` in some circumstances. E.g. the template syntax
`test {#` lets the playground crash.
This PR removes the invisible group.
Our documentation needs nightly features `doc_cfg`, `doc_auto_cfg` to
build. Instead of using the nightly channel, which is not available on
readthedocs.org, we opt in to nightly features by setting the
environment variable `RUSTC_BOOTSTRAP` to `1`. This gives on unstable
features in a stable channel.
Our dependency `proc-macro2` tests if opting-in to unstable feature is
possible, and if so, it expects that it runs on a quite recent `nightly`
release. The newest rust version that is available out-of-the-box on
readthedocs is rust 1.82, which is not *that* recent anymore, being
released on 2024-08-30.
This PR makes use of the readly configured tool `asdf` to select a more
recent rust version semi-manually.