chore: simplify tx iterator (#22365)

This commit is contained in:
DaniPopes
2026-02-27 14:09:13 +09:00
committed by GitHub
parent 233590cefd
commit 63dff64b8a

View File

@@ -822,9 +822,7 @@ impl<Tx, Err, R: Send + Sync + 'static> PayloadHandle<Tx, Err, R> {
/// Returns iterator yielding transactions from the stream.
pub fn iter_transactions(&mut self) -> impl Iterator<Item = Result<Tx, Err>> + '_ {
core::iter::repeat_with(|| self.transactions.recv())
.take_while(|res| res.is_ok())
.map(|res| res.unwrap())
self.transactions.iter()
}
}