-
Notifications
You must be signed in to change notification settings - Fork 59
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
Use pre-built timezone/directory maps by default. #193
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
fn main() { | ||
#[cfg(feature = "filter-by-regex")] | ||
chrono_tz_build::main(); | ||
|
||
#[cfg(not(feature = "filter-by-regex"))] | ||
{ | ||
if std::env::var("CHRONO_TZ_TIMEZONE_FILTER").is_ok() { | ||
println!("cargo:warning=CHRONO_TZ_TIMEZONE_FILTER set without enabling filter-by-regex feature") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From the docs:
Not sure this is useful? (Also the docs seem to indicate it should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, maybe we also need to fail the build in that case, in addition to the warning. My hope was to give a simple warning without a hard failure. I tried using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've switched this now to use |
||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,9 @@ | |
#![allow(non_snake_case)] | ||
#![allow(non_upper_case_globals)] | ||
#![allow(dead_code)] | ||
|
||
#[cfg(feature = "filter-by-regex")] | ||
include!(concat!(env!("OUT_DIR"), "/directory.rs")); | ||
|
||
#[cfg(not(feature = "filter-by-regex"))] | ||
include!("prebuilt_directory.rs"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we instead have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that'd work (the first suggestion), I'll try it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately I can't get this to work, because we need the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For what it's worth rust-analyzer seems to be able to pierce through the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we extract the duplicated code out into a function instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.