mirror of
https://github.com/pezkuwichain/revive-differential-tests.git
synced 2026-04-22 12:38:04 +00:00
7878f68c26
* Add leader and follower node assignment to test * Update the compilers interface * Fix Cargo machete * Add reporting back to the compilers * Remove the static testing target from the report * Uncomment instrument macro * Switch to a for loop when reporting cases * Update compilers to use interior caching * Update tests stream func * Fix tests
22 lines
438 B
Rust
22 lines
438 B
Rust
/// An iterator that could be either of two iterators.
|
|
#[derive(Clone, Debug)]
|
|
pub enum EitherIter<A, B> {
|
|
A(A),
|
|
B(B),
|
|
}
|
|
|
|
impl<A, B, T> Iterator for EitherIter<A, B>
|
|
where
|
|
A: Iterator<Item = T>,
|
|
B: Iterator<Item = T>,
|
|
{
|
|
type Item = T;
|
|
|
|
fn next(&mut self) -> Option<Self::Item> {
|
|
match self {
|
|
EitherIter::A(iter) => iter.next(),
|
|
EitherIter::B(iter) => iter.next(),
|
|
}
|
|
}
|
|
}
|