chronotope / chrono-tz

TimeZone implementations for rust-chrono from the IANA database
Other
239 stars 57 forks source link

Is the `std` feature useful? #179

Open pitdicker opened 7 months ago

pitdicker commented 7 months ago

The std feature controls only one thing: the error returned by Tz::from_str implements std::error::Error. That is not useless, it is just such a small thing we wouldn't implement a feature for it otherwise.

djc commented 7 months ago

I think both (a) being able to work in no_std contexts and (b) implementing std::error::Error for error types are valuable, and having a std feature doesn't seem like a big drag? So my answer would be yes.

kentborg commented 1 month ago

I've just started looking for some way to browse time zones, and get offsets from UTC for a given time zone. chrono-tz looks good…except I need no_std.

The comments above suggest it would be easy. Is it?

djc commented 1 month ago

Like many crates, chrono-tz has a std feature. If you specify default-features = false in your Cargo.toml, that should allow chrono-tz to work in no_std environments.