Keats / tera

A template engine for Rust based on Jinja2/Django
http://keats.github.io/tera/
MIT License
3.43k stars 279 forks source link

Avoid a Vec allocation #867

Closed harrisonkaiser closed 10 months ago

harrisonkaiser commented 10 months ago

This was found using clippy with -D clippy::perf. Since we know the size of the slice at compile time, we can avoid heap allocating a Vec.

harrisonkaiser commented 10 months ago

Interesting: ci / test (msrv) failed:

error: package `regex-automata v0.4.3` cannot be built because it requires rustc 1.65 or newer, while the currently active rustc version is 1.63.0

regex-automata must have bumped their msrv since the last PR.

Keats commented 10 months ago

Thanks!