Skip to content

Conversation

@rumpuslabs
Copy link
Contributor

@rumpuslabs rumpuslabs commented Sep 24, 2025

I tried to get away with passing Duration::MAX as a timeout to a function that ultimately called Receiver::recv_timeout, and got a panic.

The docs say

For cross-platform code, you can comfortably use durations of up to around one hundred years.

This PR avoids the panic by approximating durations over 100 years (or however far away your platform's maximum Instant is) with "never".

@zesterer
Copy link
Owner

Thanks! This seems like a fairly unambiguous improvement.

@zesterer zesterer merged commit 0052bac into zesterer:master Sep 24, 2025
1 of 10 checks passed
@rumpuslabs rumpuslabs deleted the fix-overflow-panic branch September 24, 2025 23:59
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