2
0
Fork 1
mirror of https://github.com/async-rs/async-std.git synced 2025-02-23 04:39:41 +00:00

Reset delay to prevent poll after ready

This commit is contained in:
Wouter Geraedts 2019-10-23 22:34:39 +02:00
parent 1c843a8124
commit 1fd05a157f

View file

@ -45,6 +45,8 @@ impl<S: Stream> Stream for Throttle<S, S::Item> {
// Sets last to None. // Sets last to None.
*self.as_mut().delay() = Some(Delay::new(self.duration)); *self.as_mut().delay() = Some(Delay::new(self.duration));
return Poll::Ready(Some(v)); return Poll::Ready(Some(v));
} else {
*self.as_mut().delay() = None;
} }
} }
} }