Skip to content
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

Replace deprecated functions #4

Merged
merged 1 commit into from
May 12, 2024

Conversation

dengelt
Copy link
Contributor

@dengelt dengelt commented Dec 30, 2023

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
Copy link
Owner

Thanks!

@felipenoris felipenoris merged commit 520c40a into felipenoris:master May 12, 2024
8 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants