icu4x
icu4x copied to clipboard
VarZeroVecFormat should be convenient to use with ZeroMap
https://github.com/unicode-org/icu4x/pull/2306 adds VarZeroVecFormat, however to use it with ZeroMap you have to manually write a ZeroMapKV implementation with a wrapper type.
We should instead add support for FormatSelector<T: VarULE, F: VZVFormat>
which implements ZeroMapKV with the same pattern used for normal VarULE types.
One tricky thing is that currently ZeroMap types use &K
and &V
, as well as K: Ord
(etc) bounds, those would all need to be switched over to K::SelfType
or something. This will make the APIs more confusing but we can document SelfType as being Self 99% of the time; so it might be fine.