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

Unexpected panics due to unwrap #1314

Closed
Xau9472 opened this issue Sep 24, 2023 · 1 comment
Closed

Unexpected panics due to unwrap #1314

Xau9472 opened this issue Sep 24, 2023 · 1 comment

Comments

@Xau9472
Copy link

Xau9472 commented Sep 24, 2023

I found two panic cases due to calling unwrap on None.

let datetime = Local::now();
datetime.sub(Months::new(312345123)); // first panic
datetime.sub(Days::new(312345123)); // second panic

It might be better to have panic msgs (e.g., with expect) and mention them in the documentation.

@pitdicker
Copy link
Collaborator

Thank you for the report. Changed to expect and added documentation in #1316.

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

No branches or pull requests

2 participants