-
Notifications
You must be signed in to change notification settings - Fork 508
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
0.5: Revise exposed crate features #1552
0.5: Revise exposed crate features #1552
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 0.5.x #1552 +/- ##
=======================================
Coverage 93.99% 93.99%
=======================================
Files 37 37
Lines 16536 16543 +7
=======================================
+ Hits 15543 15550 +7
Misses 993 993 ☔ View full report in Codecov by Sentry. |
dc0d280
to
591a995
Compare
Also updated the description in The bench feature was only used for benchmarking let year = year.rem_euclid(400);
YEAR_TO_FLAGS[year as usize] A division and a table lookup doesn't seem all that interesting to benchmark, let alone have a feature for. |
591a995
to
90dfdac
Compare
86d06a3
to
ff2057e
Compare
Much better, I think that split was definitely worth it! |
ff2057e
to
76d6583
Compare
ff64945
to
c30e360
Compare
Sorry that this is taking so many back-and-fort between us. But I'm really starting to like the changes here as good cleanups. |
@@ -27,7 +27,7 @@ clock = [ | |||
"dep:android-tzdata", | |||
"now", | |||
] | |||
now = ["std"] | |||
now = [] |
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.
So I think we should revert this change, because now
without std
is pretty much meaningless.
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.
With the commit I added now
disables no_std
, with the goal that we only depend on the standard library if the implementation for that platform requires it.
So the features describe the functionality: now
enables Utc::now
, std
enables the Error
trait and TryFrom<SystemTime>
.
Is that sensible or do you really want to revert?
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.
I think now
should enable calling Utc::now()
on most common platforms. If it doesn't, that feels broken.
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.
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.
It seems surprising that the cfg(feature = "std")
guard doesn't match the behavior of whether we enable/disable no_std
exactly (for the library).
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.
It's a choice we can make. Separating the features allows things like using Utc::now
in combination with wasmbind
without depending on the standard library.
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.
Okay, let's try it. Easier to add it later than to remove it.
c30e360
to
87f8b43
Compare
Remove the old crate features
libc
,old_time
,rkyv
andwinapi
.Switch to the
dep:
syntax for optional dependencies that where exposed as features:pure-rust-locales
,android-tzdata
,iana-time-zone
,js-sys
,wasm-bindgen
andwindows-targets
.