mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-18 02:04:19 +00:00
revset: add type parameters to remaining iterator adapters
This is another step towards removing `RevsetIterator`. These types are private, so someone using the library can't accidentally create a `UnionRevsetIterator` with inputs in different order, for example.
This commit is contained in:
parent
44e6ef9bae
commit
91e56c7f2f
1 changed files with 30 additions and 12 deletions
|
@ -1769,12 +1769,18 @@ impl<'index> ToPredicateFn<'index> for UnionRevset<'index> {
|
|||
}
|
||||
}
|
||||
|
||||
struct UnionRevsetIterator<'revset, 'index> {
|
||||
iter1: Peekable<RevsetIterator<'revset, 'index>>,
|
||||
iter2: Peekable<RevsetIterator<'revset, 'index>>,
|
||||
struct UnionRevsetIterator<
|
||||
'index,
|
||||
I1: Iterator<Item = IndexEntry<'index>>,
|
||||
I2: Iterator<Item = IndexEntry<'index>>,
|
||||
> {
|
||||
iter1: Peekable<I1>,
|
||||
iter2: Peekable<I2>,
|
||||
}
|
||||
|
||||
impl<'revset, 'index> Iterator for UnionRevsetIterator<'revset, 'index> {
|
||||
impl<'index, I1: Iterator<Item = IndexEntry<'index>>, I2: Iterator<Item = IndexEntry<'index>>>
|
||||
Iterator for UnionRevsetIterator<'index, I1, I2>
|
||||
{
|
||||
type Item = IndexEntry<'index>;
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
|
@ -1815,12 +1821,18 @@ impl<'index> ToPredicateFn<'index> for IntersectionRevset<'index> {
|
|||
}
|
||||
}
|
||||
|
||||
struct IntersectionRevsetIterator<'revset, 'index> {
|
||||
iter1: Peekable<RevsetIterator<'revset, 'index>>,
|
||||
iter2: Peekable<RevsetIterator<'revset, 'index>>,
|
||||
struct IntersectionRevsetIterator<
|
||||
'index,
|
||||
I1: Iterator<Item = IndexEntry<'index>>,
|
||||
I2: Iterator<Item = IndexEntry<'index>>,
|
||||
> {
|
||||
iter1: Peekable<I1>,
|
||||
iter2: Peekable<I2>,
|
||||
}
|
||||
|
||||
impl<'revset, 'index> Iterator for IntersectionRevsetIterator<'revset, 'index> {
|
||||
impl<'index, I1: Iterator<Item = IndexEntry<'index>>, I2: Iterator<Item = IndexEntry<'index>>>
|
||||
Iterator for IntersectionRevsetIterator<'index, I1, I2>
|
||||
{
|
||||
type Item = IndexEntry<'index>;
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
|
@ -1874,12 +1886,18 @@ impl<'index> ToPredicateFn<'index> for DifferenceRevset<'index> {
|
|||
}
|
||||
}
|
||||
|
||||
struct DifferenceRevsetIterator<'revset, 'index> {
|
||||
iter1: Peekable<RevsetIterator<'revset, 'index>>,
|
||||
iter2: Peekable<RevsetIterator<'revset, 'index>>,
|
||||
struct DifferenceRevsetIterator<
|
||||
'index,
|
||||
I1: Iterator<Item = IndexEntry<'index>>,
|
||||
I2: Iterator<Item = IndexEntry<'index>>,
|
||||
> {
|
||||
iter1: Peekable<I1>,
|
||||
iter2: Peekable<I2>,
|
||||
}
|
||||
|
||||
impl<'revset, 'index> Iterator for DifferenceRevsetIterator<'revset, 'index> {
|
||||
impl<'index, I1: Iterator<Item = IndexEntry<'index>>, I2: Iterator<Item = IndexEntry<'index>>>
|
||||
Iterator for DifferenceRevsetIterator<'index, I1, I2>
|
||||
{
|
||||
type Item = IndexEntry<'index>;
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
|
|
Loading…
Reference in a new issue