felipenoris / bdays

Business Days calendars for Rustaceans.
https://docs.rs/bdays
MIT License
17 stars 6 forks source link

Replace deprecated functions #4

Closed dengelt closed 5 months ago

dengelt commented 9 months ago

Some time ago chrono deprecated some functions like NaiveDate::from_ymd and NaiveDate::from_num_days_from_ce. These functions panic if their arguments are out of range.

I replaced the calls to these functions with their recommended alternatives (NaiveDate::from_ymd_opt and NaiveDate::from_num_days_from_ce_opt).

Most of the time I just unwrap/except, since this is equivalent behaviour to before. Alternatives would be changing some APIs to return Results/Options or using alternative functions where possible. Most occurrences of these calls are in tests anyway where that should not matter.

felipenoris commented 5 months ago

Thanks!