Skip to content

Commit bea4101

Browse files
Make Duration::not_zero public.
This is useful for downstream wanting to re-implement `TcpTransport` This struct is only ever exposed through the `unversionned` module so its fine to expose this method and remove it in the future
1 parent e196929 commit bea4101

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/timings.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,10 @@ pub struct NextTimeout {
180180
}
181181

182182
impl NextTimeout {
183-
pub(crate) fn not_zero(&self) -> Option<Duration> {
183+
/// Returns the duration of the timeout if the timeout must happen, but avoid instant timeouts
184+
///
185+
/// If the timeout must happen but is zero, returns 1 second
186+
pub fn not_zero(&self) -> Option<Duration> {
184187
if self.after.is_not_happening() {
185188
None
186189
} else if self.after.is_zero() {

0 commit comments

Comments
 (0)