mondeja / leptos-fluent

Internationalization framework for Leptos using Fluent
https://mondeja.github.io/leptos-fluent/
MIT License
38 stars 10 forks source link

`if false` and `if true` are stripped by rustc #242

Closed mondeja closed 1 week ago

mondeja commented 1 month ago

Currently, when a user provides a literal boolean option to leptos_fluent!, the library check if is a true or false literal boolean to include code or not. But the rustc compiler is enough smart to strip the conditional branching if true and if false, so we can use an expression for booleans, we don't need to parse them as possible literal booleans.

This should make the macro faster.