chronotope / chrono

Date and time library for Rust
Other
3.3k stars 523 forks source link

Swap `MappedLocalTime` and `LocalResult` type alias #1547

Closed pitdicker closed 6 months ago

pitdicker commented 6 months ago

In #1501 I thought renaming LocalResult to MappedLocalTime would be entirely without consequences as long as there is a type alias with the old name. Turns out there is one case where a type alias behaves differently :disappointed:. You can't import enum variants from a type alias with use chrono::LocalResult::*.

We have two choices:

The second choice has my preference. The docs look mostly sane, but break down once you come to the trait implementations section:

afbeelding

...

afbeelding

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 91.82%. Comparing base (ca3c3b6) to head (19dd217).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1547 +/- ## ======================================= Coverage 91.82% 91.82% ======================================= Files 40 40 Lines 18345 18345 ======================================= Hits 16846 16846 Misses 1499 1499 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

pitdicker commented 6 months ago

Published.

I'll look through the rust issue tracker if there is anything about type aliases for enums.

pitdicker commented 6 months ago

Opened https://github.com/rust-lang/rust/issues/123131.