Fix clippy blocks_in_if_conditions warning
@@ -332,12 +332,14 @@ async fn check_batch_status(
// If batch status is still pending and the wait time has not yet passed,
// send request again to re-check the batch status
- if batches_info.iter().any(|batch_info| {
+ let is_pending = batches_info.iter().any(|batch_info| {
matches!(
batch_info.status,
BatchStatus::Pending | BatchStatus::Valid(_)
)
- }) && Instant::now().duration_since(start_time) < Duration::from_secs(wait)
+ });
+ if is_pending
+ && Instant::now().duration_since(start_time) < Duration::from_secs(wait)
{
// wait one second before sending request again
sleep(Duration::from_secs(1));
