mozilla / uniffi-rs

a multi-language bindings generator for rust
https://mozilla.github.io/uniffi-rs/
Mozilla Public License 2.0
2.87k stars 232 forks source link

Update template pattern matching to leverage rinja. #2280

Closed mhammond closed 1 month ago

mhammond commented 1 month ago

Mostly using { .. }, if let, and when Some with (x) -> when Some(x)

I did this really just to play with some of the features and pattern matching always made me grumpy.

On the way I made some errors in the templates, and the error messages from rinja are vastly improved over askama - not only having very precise details about the error but often suggestions for how to fix (eg, with mismatched tags) - so thanks @GuillaumeGomez!