Closed zbraniecki closed 4 years ago
There's an alternative approach using partial suggested by Lina - https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=ad520cb4f7ece7a41e01a9079bdf7901
If you're boxing the Custom one anyway there's not much additional benefit to doing that over dynamic dispatch, dynamic dispatch isn't much more expensive if you're boxing anyway.
Implements #146.
This is an implementation based on the dynamic dispatch approach suggested by @Manishearth .
There's an alternative approach using partial suggested by Lina - https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=ad520cb4f7ece7a41e01a9079bdf7901
I like it more, but unfortunately it turns
FluentValue
into a generic and requires a pretty painful conversion of the whole codebase toFluentValue<A>
in tons of places.@Manishearth - lmk what you think, and if you prefer the generic partial approach I can go refactor the code for it.