commit c6d45e1cdc0f ("Always supply `values` to custom filters") added a
second mandatory argument, and it was not obvious what broke on upgrade
through the current explanation so write a bit more about it.
* Update version-incompatible dependencies in examples.
* Update version-incompatible dev-dependencies.
* Replaced deprecated `criterion::black_box`.
* Add `features = "simd"` to `winnow`. This adds a transitive
dependency to `memchr`, on which we already depend on directly.
If you want to fuzz the code generator, it's essential that no local
files are accessed, e.g. through `{% import %}`.
This DOES NOT mean that the generated code is safe; this is not a
sandbox. The generated code can still contain
* evil compile-time code: `{{ include_str!("/etc/passwd") }}`
* evil runtime code: `{{ std::fs::remove_dir_all("/home/user") %}`
But during the code generation nothing potentially bad should happen.
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.