mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 06:44:17 +00:00
stash
This commit is contained in:
parent
b46dffb729
commit
4fa31be5dc
1 changed files with 13 additions and 11 deletions
|
@ -23,6 +23,19 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
impl<A, B> Either<A, B> {
|
||||
pub fn map<T, U>(
|
||||
&self,
|
||||
left: impl FnOnce(&A) -> T,
|
||||
right: impl FnOnce(&B) -> U,
|
||||
) -> Either<T, U> {
|
||||
match self {
|
||||
Either::Left(i) => Either::Left(left(i)),
|
||||
Either::Right(i) => Either::Right(right(i)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
macro_rules! tuples {
|
||||
($name:ident => $($ty:ident),*) => {
|
||||
#[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)]
|
||||
|
@ -53,17 +66,6 @@ macro_rules! tuples {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*impl<$($ty,)*> Iterator for $name<$($ty,)*>
|
||||
where
|
||||
$($ty: Iterator,)*
|
||||
{
|
||||
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
|
||||
match self {
|
||||
$($name::$ty(this) => this.fmt(f),)*
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue