Skip to content

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
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