-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Case insensitive timezone matching #125
Comments
Thanks @IanWorthington We are using the One thing for us to consider is that using the If you have time we would greatly appreciate a PR to resolve this |
Thanks for your response @esheppa. I am very much a neophyte Rust programmer, but I'm happy to take a look. The first thing that occurs to me though is to ask if you /really/ would want to fail a lookup simply on a case mismatch? Are there (or could there ever be) entries that differ only by case? |
Note that we do have a |
I am working on an API (in rust of course) that has a column
I changed my test string to Thanks in advance! Here is my Cargo.toml [package]
name = "timezones"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
chrono-tz = { version = "0.8.3", features = ["case-insensitive"] } and my test program fn main() {
let iana_timezone = String::from("Etc/Gmt+5");
let tz: &chrono_tz::Tz = &iana_timezone.parse().unwrap();
println!("tz = {:?}", tz);
} |
Yes, it looks like you have to use If you have any suggestions for how to improve the documentation around this, please submit a PR. |
I read a timezone from the command line into
str
and parse it using:let ps: Result<Tz, String> = str.parse();
This works fine when I specify the timezone as CET or Europe/Paris, for example, but fails if I don't match the case correctly.
This is slightly irritating from a user's perspective. Is there any way to perform a case insensitive matching?
The text was updated successfully, but these errors were encountered: