mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-05 20:55:05 +00:00
revset: simplify type constraints on combination iterators
Just a minor cleanup to remove lifetime parameter from the types. I tried to reimplement them by using itertools, but I couldn't find a simple way to encode short-circuiting at the end of either left or right iterator.
This commit is contained in:
parent
6d59156858
commit
4d91e4c196
1 changed files with 15 additions and 21 deletions
|
@ -404,17 +404,15 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
struct UnionRevsetIterator<
|
||||
'index,
|
||||
I1: Iterator<Item = IndexEntry<'index>>,
|
||||
I2: Iterator<Item = IndexEntry<'index>>,
|
||||
> {
|
||||
struct UnionRevsetIterator<I1: Iterator, I2: Iterator> {
|
||||
iter1: Peekable<I1>,
|
||||
iter2: Peekable<I2>,
|
||||
}
|
||||
|
||||
impl<'index, I1: Iterator<Item = IndexEntry<'index>>, I2: Iterator<Item = IndexEntry<'index>>>
|
||||
Iterator for UnionRevsetIterator<'index, I1, I2>
|
||||
impl<'index, I1, I2> Iterator for UnionRevsetIterator<I1, I2>
|
||||
where
|
||||
I1: Iterator<Item = IndexEntry<'index>>,
|
||||
I2: Iterator<Item = IndexEntry<'index>>,
|
||||
{
|
||||
type Item = IndexEntry<'index>;
|
||||
|
||||
|
@ -478,17 +476,15 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
struct IntersectionRevsetIterator<
|
||||
'index,
|
||||
I1: Iterator<Item = IndexEntry<'index>>,
|
||||
I2: Iterator<Item = IndexEntry<'index>>,
|
||||
> {
|
||||
struct IntersectionRevsetIterator<I1: Iterator, I2: Iterator> {
|
||||
iter1: Peekable<I1>,
|
||||
iter2: Peekable<I2>,
|
||||
}
|
||||
|
||||
impl<'index, I1: Iterator<Item = IndexEntry<'index>>, I2: Iterator<Item = IndexEntry<'index>>>
|
||||
Iterator for IntersectionRevsetIterator<'index, I1, I2>
|
||||
impl<'index, I1, I2> Iterator for IntersectionRevsetIterator<I1, I2>
|
||||
where
|
||||
I1: Iterator<Item = IndexEntry<'index>>,
|
||||
I2: Iterator<Item = IndexEntry<'index>>,
|
||||
{
|
||||
type Item = IndexEntry<'index>;
|
||||
|
||||
|
@ -564,17 +560,15 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
struct DifferenceRevsetIterator<
|
||||
'index,
|
||||
I1: Iterator<Item = IndexEntry<'index>>,
|
||||
I2: Iterator<Item = IndexEntry<'index>>,
|
||||
> {
|
||||
struct DifferenceRevsetIterator<I1: Iterator, I2: Iterator> {
|
||||
iter1: Peekable<I1>,
|
||||
iter2: Peekable<I2>,
|
||||
}
|
||||
|
||||
impl<'index, I1: Iterator<Item = IndexEntry<'index>>, I2: Iterator<Item = IndexEntry<'index>>>
|
||||
Iterator for DifferenceRevsetIterator<'index, I1, I2>
|
||||
impl<'index, I1, I2> Iterator for DifferenceRevsetIterator<I1, I2>
|
||||
where
|
||||
I1: Iterator<Item = IndexEntry<'index>>,
|
||||
I2: Iterator<Item = IndexEntry<'index>>,
|
||||
{
|
||||
type Item = IndexEntry<'index>;
|
||||
|
||||
|
|
Loading…
Reference in a new issue