Skip to content

Handle potential overflow gracefully#68

Open
nazar-pc wants to merge 1 commit intoasync-rs:masterfrom
nazar-pc:handle-overflow-gracefully
Open

Handle potential overflow gracefully#68
nazar-pc wants to merge 1 commit intoasync-rs:masterfrom
nazar-pc:handle-overflow-gracefully

Conversation

@nazar-pc
Copy link
Copy Markdown

I had a use case to use Duration::MAX with one of the libraries using delay internally to effectively disable a delayed operation and hit overflow.

This simple change effectively makes addition saturating (unfortunately standard library didn't have a convenient method for it).

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.

1 participant