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

Missing panic condition on doc #1302

Closed
HeeillWang opened this issue Sep 20, 2023 · 1 comment
Closed

Missing panic condition on doc #1302

HeeillWang opened this issue Sep 20, 2023 · 1 comment

Comments

@HeeillWang
Copy link

Though this is intentional crash, I think it's better to mention on docs as well, like some other APIs mentions it.

chrono/src/datetime/mod.rs

Lines 1254 to 1258 in b64cedc

fn sub(self, rhs: Duration) -> DateTime<Tz> {
let rhs = TimeDelta::from_std(rhs)
.expect("overflow converting from core::time::Duration to chrono::Duration");
self.checked_sub_signed(rhs).expect("`DateTime - Duration` overflowed")
}

@pitdicker
Copy link
Collaborator

Thank you for the report. Fixed 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