-
Notifications
You must be signed in to change notification settings - Fork 37
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
switch from time to systemtime #53
Conversation
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.
Hi Eric! Thank you for you contribution. Currently the PR is not compiling:
$ cargo test
Compiling ulid v0.6.0
error[E0433]: failed to resolve: use of undeclared type `Duration`
--> src\generator.rs:182:46
|
182 | let ulid3 = Ulid::from_datetime(dt + Duration::from_millis(1));
| ^^^^^^^^ not found in this sc
ope
|
help: consider importing one of these items
|
174 | use core::time::Duration;
|
174 | use std::time::Duration;
|
For more information about this error, try `rustc --explain E0433`.
error: could not compile `ulid` due to previous error
warning: build failed, waiting for other jobs to finish...
Can you fix the issues? The following should all pass:
cargo test
cargo test --all-features
cargo test --no-default-features --features=std
cargo test --no-default-features
Thanks!
Thanks for the review @dylanhart - I've fixed the compile error and verified with 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.
Hi Eric! Thanks for the update. Can you remove the panicking .unwrap()
calls? Thanks!
fix compile failure, clippy lints, check of cli in ci handle SystemTimes before UNIX_EPOCH by truncating add empty feature to avoid breaking users with the feature selected
Thanks @dylanhart - I've fixed those |
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.
This looks great. The code and rustdoc look good to me. Just one comment on cargo features.
I've cleaned up the Cargo.toml and README.md. I've left the benchmarks as is as I assume you'd like to run them on your computer for consistency |
Looks good! Thanks! Will make a release for this later. |
Available in v1.0.0 |
This reduces a dependency, but also makes
ulid
compatible with all datetime libraries as the internal types generally implementFrom<SystemTime>
.This should also solve #52 and potentially #50