From fb50bc5a24217a9bdb0b8c889f5cadcc212f40f9 Mon Sep 17 00:00:00 2001 From: christn Date: Mon, 5 Aug 2024 11:56:47 +0800 Subject: [PATCH] fix: use is_empty() to make clippy happy --- src/phoenix/consensus_node.rs | 6 +++--- src/phoenix/validation_node.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/phoenix/consensus_node.rs b/src/phoenix/consensus_node.rs index e1f0470..eab2034 100644 --- a/src/phoenix/consensus_node.rs +++ b/src/phoenix/consensus_node.rs @@ -36,10 +36,10 @@ impl ConsensusNodeMonitor { info!("{}/{} consensus nodes synced", synced.len(), results.len()); - if synced.len() > 0 { - Ok(Utc::now()) - } else { + if synced.is_empty() { Err(anyhow!("all consensus nodes out of sync")) + } else { + Ok(Utc::now()) } } } diff --git a/src/phoenix/validation_node.rs b/src/phoenix/validation_node.rs index 42164a9..77496d3 100644 --- a/src/phoenix/validation_node.rs +++ b/src/phoenix/validation_node.rs @@ -53,10 +53,10 @@ impl ValidationNodeMonitor { info!("{}/{} validation nodes synced", synced.len(), results.len()); - if synced.len() > 0 { - Ok(Utc::now()) - } else { + if synced.is_empty() { Err(anyhow!("all validation nodes out of sync")) + } else { + Ok(Utc::now()) } } }