icu4x icon indicating copy to clipboard operation
icu4x copied to clipboard

Organize properties code to be more like the other crates (get rid of free functions)

Open Manishearth opened this issue 1 year ago • 8 comments

This is probably a 2.0 change (https://github.com/unicode-org/icu4x/issues/2856)

The properties code uses a lot of free functions for loading property maps and such, rather than using constructors on CodePointSetData and CodePointMapData as would be tradition in the other crates.

This makes things a bit awkward. We should consider this design again for 2.0.

Some open questions:

  • How do we deal with the fact that CodePointMapData is generic, and that Rust users will be using CodePointMapData<GeneralCategory> (etc) whereas FFI uses an erased version?
  • How do we expose default baked data in this regime?

To-do items:

  • icu_properties::exemplar_chars fns should not need "exemplar" in the name
  • The mapper functions should be named load_ instead of get_

cc @robertbastian @sffc

Low-priority discussion since it's likely a 2.0 issue.

Manishearth avatar Jun 22 '23 16:06 Manishearth