chronotope / chrono-tz

TimeZone implementations for rust-chrono from the IANA database
Other
228 stars 55 forks source link

Is UTC stripped out too? Should we update the Readme? #148

Closed frederikhors closed 3 months ago

frederikhors commented 4 months ago

I'm using the env var $env:CHRONO_TZ_TIMEZONE_FILTER='(Europe/Berlin)' and building with cargo build, then I get this error:

Compiling chrono-tz v0.8.6
error[E0599]: no variant or associated item named `UTC` found for enum `Tz` in the current scope
  --> C:\Users\Fred\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-tz-0.8.6\src\timezone_impl.rs:14:13
   |
14 |         Tz::UTC
   |             ^^^ variant or associated item not found in `Tz`
   |
  ::: C:\prj\target\release\build\chrono-tz-5b053da3462d6436\out/timezones.rs:13:1
   |
13 | pub enum Tz {
   | ----------- variant or associated item `UTC` not found for this enum

For more information about this error, try `rustc --explain E0599`.
error: could not compile `chrono-tz` (lib) due to 1 previous error

Why?

Is UTC stripped out too? Should we update the Readme?

djc commented 4 months ago

Yeah, I would expect that UTC gets stripped out too if you do that. Why do we need to update the README for that?

frederikhors commented 4 months ago

Sorry, my bad. I was using UTC elsewhere too.

frederikhors commented 4 months ago

@djc my bad. I think we should reopen this.

What I'm noticing here is that in the regex it is necessary to have UTC too even if I don't use it in my code.

I think we should understand why or update Readme.

djc commented 4 months ago

I'm open to that, but I won't be able to dig into it myself. If you're able to spend some time on understanding why that happens, I think that would be useful and we can discuss how we can improve the situation.

frederikhors commented 4 months ago

I'll try in a few days...