icu4x
icu4x copied to clipboard
ICU4XZonedDateTimeFormatter should take an optional date and time length
Currently the FFI function ICU4XZonedDateTimeFormatter::create_with_lengths takes a non-optional date length and time length. However, the Rust equivalent function takes these as optional. We should reflect the optionality in FFI.
Unclear which approach we should take:
- Optional argument. Need to add support for this to Diplomat.
- Add a
Nonevariant to the enums in FFI.
CC @robertbastian @mosuem
I am not sure if I am the right person, but I feel we should add this support in the Diplomat. This seems to be a common feature and it should feel like writing native Rust.
Option 2 is not doable at the moment, because the enums are shared with TimeFormatter et al, where they are not optional.
We have optionals in Diplomat now, so I think we should do 1. (edit: actually input Optionals still need work...)