Skip to content

Commit

Permalink
Simplify commas in impl_tuple_combination macro
Browse files Browse the repository at this point in the history
  • Loading branch information
Philippe-Cholet committed Oct 27, 2023
1 parent 52c3b56 commit baaf852
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/adaptors/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -736,14 +736,14 @@ macro_rules! impl_tuple_combination {
type Item = (A, $(ignore_ident!($X, A)),*);

fn next(&mut self) -> Option<Self::Item> {
if let Some(($($X),*,)) = self.c.next() {
if let Some(($($X,)*)) = self.c.next() {
let z = self.item.clone().unwrap();
Some((z, $($X),*))
} else {
self.item = self.iter.next();
self.item.clone().and_then(|z| {
self.c = self.iter.clone().into();
self.c.next().map(|($($X),*,)| (z, $($X),*))
self.c.next().map(|($($X,)*)| (z, $($X),*))
})
}
}
Expand All @@ -769,13 +769,13 @@ macro_rules! impl_tuple_combination {
let Self { c, item, mut iter } = self;
if let Some(z) = item.as_ref() {
init = c
.map(|($($X),*,)| (z.clone(), $($X),*))
.map(|($($X,)*)| (z.clone(), $($X),*))
.fold(init, &mut f);
}
while let Some(z) = iter.next() {
let c: $P<I> = iter.clone().into();
init = c
.map(|($($X),*,)| (z.clone(), $($X),*))
.map(|($($X,)*)| (z.clone(), $($X),*))
.fold(init, &mut f);
}
init
Expand Down

0 comments on commit baaf852

Please sign in to comment.