refactor: replace collect().is_empty() with next().is_none() in tests (#18902)

Co-authored-by: Alexey Shekhirin <5773434+shekhirin@users.noreply.github.com>
This commit is contained in:
Merkel Tranjes
2025-10-08 16:20:39 +02:00
committed by GitHub
parent 6770ba9eed
commit c0caaa17be
2 changed files with 2 additions and 4 deletions

View File

@@ -1380,8 +1380,7 @@ mod tests {
#[test]
fn test_canonical_in_memory_state_canonical_chain_empty() {
let state: CanonicalInMemoryState = CanonicalInMemoryState::empty();
let chain: Vec<_> = state.canonical_chain().collect();
assert!(chain.is_empty());
assert!(state.canonical_chain().next().is_none());
}
#[test]

View File

@@ -921,8 +921,7 @@ mod tests {
assert!(removed.is_empty());
// Verify that retrieving transactions from an empty pool yields nothing
let all_txs: Vec<_> = pool.all().collect();
assert!(all_txs.is_empty());
assert!(pool.all().next().is_none());
}
#[test]