chore: declare and check MSRV (#1034)
* chore: declare and check MSRV * fix: clippy fixes for collapsing if-statements * ci: add explicit contents read permission to MSRV job
This commit is contained in:
parent
e660b805ee
commit
76988023b2
1 changed files with 322 additions and 315 deletions
|
|
@ -178,10 +178,10 @@ pub struct FixedInterval {
|
|||
|
||||
impl SseRetryPolicy for FixedInterval {
|
||||
fn retry(&self, current_times: usize) -> Option<Duration> {
|
||||
if let Some(max_times) = self.max_times {
|
||||
if current_times >= max_times {
|
||||
return None;
|
||||
}
|
||||
if let Some(max_times) = self.max_times
|
||||
&& current_times >= max_times
|
||||
{
|
||||
return None;
|
||||
}
|
||||
Some(self.duration)
|
||||
}
|
||||
|
|
@ -222,10 +222,10 @@ impl Default for ExponentialBackoff {
|
|||
|
||||
impl SseRetryPolicy for ExponentialBackoff {
|
||||
fn retry(&self, current_times: usize) -> Option<Duration> {
|
||||
if let Some(max_times) = self.max_times {
|
||||
if current_times >= max_times {
|
||||
return None;
|
||||
}
|
||||
if let Some(max_times) = self.max_times
|
||||
&& current_times >= max_times
|
||||
{
|
||||
return None;
|
||||
}
|
||||
Some(self.base_duration * (2u32.pow(current_times as u32)))
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue