Fold fallback::Status::reset() into its (only) caller.

This commit is contained in:
Nick Mathewson 2022-03-29 08:48:08 -04:00
parent 9bf2fe3aca
commit b752c6c771
1 changed files with 2 additions and 7 deletions

View File

@ -50,18 +50,13 @@ impl Status {
self.retry_at
}
/// Restore this `Status` to its original state.
pub(crate) fn reset(&mut self) {
self.retry_at = None;
self.delay = RetryDelay::from_duration(FALLBACK_RETRY_FLOOR);
}
/// Record that the associated fallback directory has been used successfully.
///
/// This should only be done after successfully handling a whole reply from the
/// directory.
pub(crate) fn note_success(&mut self) {
self.reset();
self.retry_at = None;
self.delay = RetryDelay::from_duration(FALLBACK_RETRY_FLOOR);
}
/// Record that the associated fallback directory has failed.