File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ impl<T: Future> Retry for T {
2121pub struct RetryFuture < F > {
2222 inner : F ,
2323 tries : u32 ,
24- base_delay : Option < Duration > ,
24+ base_delay : Duration ,
2525 attempts : u32 ,
2626 sleep : Option < Pin < Box < dyn Future < Output = ( ) > > > > ,
2727}
@@ -32,7 +32,7 @@ impl<F> RetryFuture<F> {
3232 Self {
3333 inner,
3434 tries,
35- base_delay : Some ( base_delay ) ,
35+ base_delay,
3636 attempts : 0 ,
3737 sleep : None ,
3838 }
6666 return Poll :: Ready ( Err ( e) ) ;
6767 }
6868
69- if let Some ( base_delay) = this. base_delay {
70- this. sleep = Some ( Box :: pin ( tokio:: time:: sleep (
71- base_delay * 2_u32 . pow ( this. attempts ) ,
72- ) ) ) ;
73- }
69+ this. sleep = Some ( Box :: pin ( tokio:: time:: sleep (
70+ this. base_delay * 2_u32 . pow ( this. attempts ) ,
71+ ) ) ) ;
7472
7573 Poll :: Pending
7674 }
You can’t perform that action at this time.
0 commit comments