| 708 | type Item = AtomRef<'a, H>; |
| 709 | |
| 710 | fn next(&mut self) -> Option<Self::Item> { |
| 711 | let result = match (self.graph_op, self.index) { |
| 712 | // FileAdd: add_name, add_inode, contents |
| 713 | (GraphOp::FileAdd { add_name, .. }, 0) => Some(AtomRef::Insertion(add_name)), |
| 714 | (GraphOp::FileAdd { add_inode, .. }, 1) => Some(AtomRef::Insertion(add_inode)), |
| 715 | ( |
| 716 | GraphOp::FileAdd { |
| 717 | contents: Some(c), .. |
| 718 | }, |
| 719 | 2, |
| 720 | ) => Some(AtomRef::Insertion(c)), |
| 721 | (GraphOp::FileAdd { .. }, _) => None, |
| 722 | |
| 723 | // FileDel: del, contents |
| 724 | (GraphOp::FileDel { del, .. }, 0) => Some(AtomRef::EdgeUpdate(del)), |
| 725 | ( |
| 726 | GraphOp::FileDel { |
| 727 | contents: Some(c), .. |
| 728 | }, |
| 729 | 1, |
| 730 | ) => Some(AtomRef::EdgeUpdate(c)), |
| 731 | (GraphOp::FileDel { .. }, _) => None, |
| 732 | |
| 733 | // FileUndel: undel, contents |
| 734 | (GraphOp::FileUndel { undel, .. }, 0) => Some(AtomRef::EdgeUpdate(undel)), |
| 735 | ( |
| 736 | GraphOp::FileUndel { |
| 737 | contents: Some(c), .. |
| 738 | }, |
| 739 | 1, |
| 740 | ) => Some(AtomRef::EdgeUpdate(c)), |
| 741 | (GraphOp::FileUndel { .. }, _) => None, |
| 742 | |
| 743 | // FileMove: del, add |
| 744 | (GraphOp::FileMove { del, .. }, 0) => Some(AtomRef::EdgeUpdate(del)), |
| 745 | (GraphOp::FileMove { add, .. }, 1) => Some(AtomRef::Insertion(add)), |
| 746 | (GraphOp::FileMove { .. }, _) => None, |
| 747 | |
| 748 | // Edit: change |
| 749 | (GraphOp::Edit { change, .. }, 0) => Some(AtomRef::Atom(change)), |
| 750 | (GraphOp::Edit { .. }, _) => None, |
| 751 | |
| 752 | // Replacement: change, replacement |
| 753 | (GraphOp::Replacement { change, .. }, 0) => Some(AtomRef::EdgeUpdate(change)), |
| 754 | (GraphOp::Replacement { replacement, .. }, 1) => Some(AtomRef::Insertion(replacement)), |
| 755 | (GraphOp::Replacement { .. }, _) => None, |
| 756 | |
| 757 | // SolveNameConflict: name |
| 758 | (GraphOp::SolveNameConflict { name, .. }, 0) => Some(AtomRef::EdgeUpdate(name)), |
| 759 | (GraphOp::SolveNameConflict { .. }, _) => None, |
| 760 | |
| 761 | // UnsolveNameConflict: name |
| 762 | (GraphOp::UnsolveNameConflict { name, .. }, 0) => Some(AtomRef::EdgeUpdate(name)), |
| 763 | (GraphOp::UnsolveNameConflict { .. }, _) => None, |
| 764 | |
| 765 | // SolveOrderConflict: change |
| 766 | (GraphOp::SolveOrderConflict { change, .. }, 0) => Some(AtomRef::EdgeUpdate(change)), |
| 767 | (GraphOp::SolveOrderConflict { .. }, _) => None, |