time-rs / time

The most used Rust library for date and time handling.
https://time-rs.github.io
Apache License 2.0
1.06k stars 261 forks source link

Clarify the format used by Display is may change #667

Closed softdevca closed 4 months ago

softdevca commented 4 months ago

Additional documentation that the format of display may change and should not be relied upon, as indicated as comment in #666

jhpratt commented 4 months ago

This is the case for any type implementing Display (in any crate) unless the documentation says it can be relied upon. The stability guarantee is what is documented, and the output is not documented as stable.

softdevca commented 4 months ago

I am unable to find any documentation the format of fmt::Display is unstable. Not in the documentation for the Rust API (including alloc and core), not in the Rust book or anywhere else. It may be true that colloquially Display cannot be relied upon but I respectfully believe it would be clearer if it was made explicit. If for no other reason than to assist new users of the time crate .

jhpratt commented 4 months ago

So long as the output is correct, any value is valid. The lack of a stability promise implies instability. This is semantic versioning, which deals with public API. In the case of time (and most Rust crates), this public API exists in the form of documentation. No where have I documented (and asserted the unchanging nature of) the output of Display, so it is simply not subject to semver.

softdevca commented 4 months ago

Thank you for the clear and fair explanation.