icu4x icon indicating copy to clipboard operation
icu4x copied to clipboard

VarZeroVecFormat should be convenient to use with ZeroMap

Open Manishearth opened this issue 1 year ago • 0 comments

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.

Manishearth avatar Aug 02 '22 20:08 Manishearth