djc / askama

Type-safe, compiled Jinja-like templates for Rust
Apache License 2.0
3.35k stars 215 forks source link

Add checks for chars at compile time #1020

Closed GuillaumeGomez closed 4 months ago

GuillaumeGomez commented 4 months ago

Fixes https://github.com/djc/askama/issues/1018.

Now if a char is invalid, it will fail at parsing-time and not at compile-time anymore.

GuillaumeGomez commented 4 months ago

And fixed clippy lints. :)

GuillaumeGomez commented 4 months ago

Transformed the function into a closure and now map the error on failure.

GuillaumeGomez commented 4 months ago

Reworked as suggested.

GuillaumeGomez commented 4 months ago

Thanks for the reviews!