Skip to content

Commit

Permalink
refactor: Remove the Debug requirement of Backoff (#141)
Browse files Browse the repository at this point in the history
Signed-off-by: Xuanwo <github@xuanwo.io>
  • Loading branch information
Xuanwo authored Sep 4, 2024
1 parent 50ce185 commit 1c34c4a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions backon/src/backoff/api.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use core::fmt::Debug;
use core::time::Duration;

/// BackoffBuilder is utilized to construct a new backoff.
pub trait BackoffBuilder: Debug + Send + Sync + Unpin {
pub trait BackoffBuilder: Send + Sync + Unpin {
/// The associated backoff returned by this builder.
type Backoff: Backoff;

Expand All @@ -15,4 +14,4 @@ pub trait BackoffBuilder: Debug + Send + Sync + Unpin {
/// - `Some(Duration)` indicates the caller should `sleep(Duration)` and retry the request.
/// - `None` indicates the limits have been reached, and the caller should return the current error instead.
pub trait Backoff: Iterator<Item = Duration> + Send + Sync + Unpin {}
impl<T> Backoff for T where T: Iterator<Item = Duration> + Debug + Send + Sync + Unpin {}
impl<T> Backoff for T where T: Iterator<Item = Duration> + Send + Sync + Unpin {}

0 comments on commit 1c34c4a

Please sign in to comment.