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

RUST-1677 Add duration_since methods to DateTime #417

Merged
merged 3 commits into from
Jun 9, 2023

Conversation

isabelatkinson
Copy link
Contributor

Adds checked_duration_since and saturating_duration_since methods to crate::DateTime. These are based off of the methods of the same name in std::time::Instant. I chose not to add any Sub implementation because we'd need to decide what to do when the result is negative (i.e. panic or return 0); I'd rather let users make this decision explicitly.

@isabelatkinson isabelatkinson requested a review from abr-egn June 9, 2023 16:38
@isabelatkinson
Copy link
Contributor Author

I can't repro the MSRV failure locally, but it seems to be unrelated to these changes

@isabelatkinson isabelatkinson merged commit b243db1 into mongodb:main Jun 9, 2023
@isabelatkinson isabelatkinson deleted the add-sub-to-datetime branch June 9, 2023 20:51
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants