Open
Description
Delay::new can panic due Subtracting Duration from Instant on Mac is panic-prone, it can be seen in this action run.
Suggestion: add documentation, similar to the add implementation for Instant:
impl Add<Duration> for Instant {
type Output = Instant;
/// # Panics
///
/// This function may panic if the resulting point in time cannot be represented by the
/// underlying data structure. See [`Instant::checked_add`] for a version without panic.
fn add(self, other: Duration) -> Instant {
self.checked_add(other).expect("overflow when adding duration to instant")
}
}
And/or add an checked function variant for Delay::new, like this.
Metadata
Metadata
Assignees
Labels
No labels