Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Remove the Debug requirement of Backoff #141

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 {}