Skip to content
Snippets Groups Projects
Commit 57608f96 authored by Nick Mathewson's avatar Nick Mathewson :game_die:
Browse files

Add RetrySchedule::reset()

Previously the code would do stuff like

```
    schedule = RetrySchedule::new(INITIAL_DELAY);
```

which is needlessly verbose, since the schedule already keeps track
of its initial delay.
parent 75fd63a1
No related branches found
No related tags found
No related merge requests found
......@@ -103,6 +103,11 @@ impl RetryDelay {
pub fn next_delay<R: Rng>(&mut self, rng: &mut R) -> Duration {
Duration::from_millis(u64::from(self.next_delay_msec(rng)))
}
/// Return this [`RetryDelay`] to its original state.
pub fn reset(&mut self) {
self.last_delay_ms = 0;
}
}
impl Default for RetryDelay {
......
......@@ -18,6 +18,10 @@ We can delete older sections here after we bump the releases.
## Since Arti 0.2.0
### tor-basic-util
MODIFIED: Added `reset()` method to RetrySchedule.
### tor-socksproto
BREAKING: Removed some unused accessors.
......@@ -25,4 +29,3 @@ BREAKING: Removed some unused accessors.
### tor-rtmock
MODIFIED: Added add_blackhole to MockNetwork.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment