-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Unnecessary dependency on chrono #6
Comments
That's a thing about Rust.. it does not have date in it's standard library. I had to search for a lib that was popular enough. Personally I don't like the I like the idea of defining a trait. But, then, anyone that would like to use |
@felipenoris, indeed. The lack of a more fully-feature standard library is a common pain in Rust.
Not necessarily! We may use cargo features to make bdays provide built-in integration with the most common date libraries, such as chrono, time, and jiff. The trait (e.g. With this design, if some user downloads this crate with the Should we proceed with this design, I should also note that through optional dependencies, a bdays downstream user would not be forced to transitively depend on chrono, time, or jiff. Such a dependency would be enabled only when the feature for the specific upstream crate is enabled. |
First of all, thanks for your work on this library :-)
At $work, our services depend on the time crate for date/time stuff. There is also the new jiff crate, which will probably gain some popularity in the future. In general, since the Rust ecosystem has many date/time libraries, one could argue that libraries such as bdays should be agnostic over them.
However, that's currently not the case, as the
HolidayCalendar
trait has a bound restricting the generic type to the chronoDatelike
trait. As a solution, bdays could define and expose its own Datelike trait. WDYT?I may be able to send a PR.
The text was updated successfully, but these errors were encountered: