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