rinja-rs / rinja

A template rendering engine based on Jinja, generating type-safe Rust code at compile time.
https://rinja.readthedocs.io
Apache License 2.0
116 stars 10 forks source link

derive: make sure that static CACHE is never dropped #108

Closed Kijewski closed 2 months ago

Kijewski commented 2 months ago

We assume that static CACHE of Configs is never dropped, so we only pass &'static Config around. It is an implementation detail in rust, that static variables (currently) aren't dropped at the program's termination. This PR makes sure that this behavior stays the same even if this fact is changed later on.

Also, needless usages of Arc and some some unsafe code was removed.

GuillaumeGomez commented 2 months ago

Good idea, thanks!