Skip to content

Use simpler constructor to cast from chrono_tz::Tz#141

Open
WhyNotHugo wants to merge 6 commits intofmeringdal:mainfrom
WhyNotHugo:tz-constructor
Open

Use simpler constructor to cast from chrono_tz::Tz#141
WhyNotHugo wants to merge 6 commits intofmeringdal:mainfrom
WhyNotHugo:tz-constructor

Conversation

@WhyNotHugo
Copy link
Contributor

@WhyNotHugo WhyNotHugo commented Sep 6, 2025

Instead of generating one const variant of Tz for each chrono_tz::tz variant, provide a const function to convert chrono_tz::Tz into Tz in a static context.

The main change here is the introduction of Tz::from_static(). Other changes merely adapt existing code to use this instead of chrono_tz directly.

Usages such as:

Tz::America__Los_Angeles;

Become:

Tz::from_static(chrono_tz::America::Los_Angeles)

Using the nightly compiler is a burden for contributors — a lot of
platforms don't ship builds of the nightly compiler. In order to use
nightly, we'd need to compile it from source.
macOS CI builders run on aarch64, but CI attempts to fetch the toolchain
for x86_64.
@WhyNotHugo
Copy link
Contributor Author

Currently includes commits from https://github.com//rust-rrule/pull/140, should be rebased once that is merged.

Instead of generating one const variant of Tz for each chrono_tz::tz
variant, provide a const function to convert chrono_tz::Tz into Tz in a
static context.

The main change here is the introduction of Tz::from_static(). Other
changes merely adapt existing code to use this instead of chrono_tz
directly.

Usages such as:

    Tz::America__Los_Angeles;

Become:

    Tz::from_static(chrono_tz::America::Los_Angeles)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant