MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / next

Method next

atomic-core/src/change/graph_op.rs:710–808  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

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,

Callers 2

test_tracker_unresolvedFunction · 0.45
summaryMethod · 0.45

Calls 3

InsertionClass · 0.85
EdgeUpdateClass · 0.85
AtomEnum · 0.85

Tested by 1

test_tracker_unresolvedFunction · 0.36