icu4x icon indicating copy to clipboard operation
icu4x copied to clipboard

More docs tweaks in the icu::datetime crate

Open sffc opened this issue 1 year ago • 4 comments

From API review with @markusicu:

  • [ ] In main example, the comment string should be “Calendars match” instead of "Formatting should succeed" for the .expect() call for formatted_date. See how the examples work in e.g. ZonedDateTimeFormatter.
  • [ ] Add module-level docs to icu::datetime::time_zone
  • [ ] TypedZonedDateTimeFormatter example does not assert what the output is equal to, but should
  • [ ] ZonedDateTimeFormatter examples somewhere should use a non-GMT time zone
  • [ ] The TimeZoneFormatter::load_*() functions return themselves, so that you can chain. We should say that in the docs
  • [ ] In general, TimeZoneFormatter is a power user thing, and the docs should say so
  • [ ] Because of this, remove the top-level reexport of TimeZoneFormatter, and leave it as icu::datetime::time_zone::TimeZoneFormatter (and update the diplomat rust_links and coverage tool to reflect this)
  • [ ] Ensure all experimental modules are marked as such (sub-issue: #2409)
  • [ ] In icu_timezone: Specify that that Zone Variant is optional, which is why you don’t need a generic variant

sffc avatar Sep 03 '22 01:09 sffc

@echeran OK if I assign this one to you?

sffc avatar Sep 03 '22 01:09 sffc

Something else I noticed: AnyCalendar, DateFormatter, DateTimeFormatter, and ZonedDateTimeFormatter are the only types in all components that do not use the macro to declare _with_any_provider and _with_buffer_provider, and have separate docs for these functions. Should those be simplified?

robertbastian avatar Sep 05 '22 10:09 robertbastian

@Manishearth wrote those functions and docs. I didn't delete them when I added the macro everywhere else. I think it's fine for them to have extra docs; the macro is a convenience for us but results in slightly lower quality docs for consumers.

sffc avatar Sep 06 '22 05:09 sffc

Yeah the macro didn't exist when I started these but also I want them to have separate docs and doctests.

Manishearth avatar Sep 06 '22 16:09 Manishearth