Comments (4)
I think the biggest "offender" is my macro
macro_rules! unwrap {
($($tt:tt)*) => {
match $($tt)* {
Ok(value) => value,
Err(_) => {
#[allow(unconditional_panic)]
let err = [][0];
err
}
}
}
}
If I replace it with ↓, then the compile time is about 4 times faster in the simple test I did.
pub(crate) const fn time_zone_ref_new(
transitions: &'static [tz::timezone::Transition],
local_time_types: &'static [tz::LocalTimeType],
leap_seconds: &'static [tz::timezone::LeapSecond],
extra_rule: &'static Option<tz::timezone::TransitionRule>,
) -> TimeZoneRef<'static> {
match TimeZoneRef::new(transitions, local_time_types, leap_seconds, extra_rule) {
Ok(value) => value,
Err(_) => {
#[allow(unconditional_panic)]
let err = [][0];
err
},
}
}
I'll test it properly in the next few days.
Changing the default features would be a breaking change. But I could use breaking change this to increase the msrv from 1.56 to 1.57, so I could use panic!()
in time_zone_ref_new()
. I'll think about it. :)
from tzdb.
This works great! thanks @Kijewski 🙇
I've gone ahead and upgraded to tzdb v0.6.0-pre.1.
from tzdb.
Please have a look if the path I took in tzdb = "0.6.0-pre.1"
would work for you:
features = ["local"]
enables function that useiana_time_zone
.- If included,
iana_time_zone
is always used withfeature = ["fallback"]
from tzdb.
Thank you for testing the pre-release! :) I just pushed the stable release 0.6.0.
from tzdb.
Related Issues (12)
- Don't generate time zones with leap seconds by default HOT 1
- tzdb::local_tz() function get None in linux, expect get Some value . HOT 4
- tzdb::local_tz() function get None ,existing problems tzdb 0.4.1 version HOT 4
- Use a git submodule instead of squashing commits HOT 3
- RUSTSEC-2021-0127: serde_cbor is unmaintained HOT 1
- Optional `now` module in 0.5.x HOT 3
- Missing tag & changelog for 0.4.8 HOT 2
- Transition date ranges HOT 2
- Get Current Time Zone Name HOT 2
- Error for zones with underscore like Asia/Ho_Chi_Minh HOT 2
- Does tzdb support no_std? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tzdb.