nested route matching

This commit is contained in:
Greg Johnston
2024-03-02 15:36:05 -05:00
parent f894d6e4f6
commit f122f9109f
6 changed files with 200 additions and 215 deletions

View File

@@ -2,7 +2,7 @@
use core::fmt::Display;
#[derive(Debug)]
#[derive(Debug, Clone, Copy)]
pub enum Either<A, B> {
Left(A),
Right(B),
@@ -41,6 +41,19 @@ macro_rules! tuples {
}
}
impl<Item, $($ty,)*> Iterator for $name<$($ty,)*>
where
$($ty: Iterator<Item = Item>,)*
{
type Item = Item;
fn next(&mut self) -> Option<Self::Item> {
match self {
$($name::$ty(i) => i.next(),)*
}
}
}
/*impl<$($ty,)*> Iterator for $name<$($ty,)*>
where
$($ty: Iterator,)*