Returns the leaf operations (new content for Insert/Modify, old content for Delete). Returns an empty slice for Restore operations.
(&self)
| 579 | /// |
| 580 | /// Returns an empty slice for Restore operations. |
| 581 | pub fn leaf_ops(&self) -> &[LeafOp] { |
| 582 | match &self.operation { |
| 583 | BranchOp::Insert { content, .. } => content, |
| 584 | BranchOp::Delete { content, .. } => content, |
| 585 | BranchOp::Modify { new_content, .. } => new_content, |
| 586 | BranchOp::Restore { .. } => &[], |
| 587 | BranchOp::Reparent { .. } => &[], |
| 588 | } |
| 589 | } |
| 590 | |
| 591 | /// Returns the number of leaf operations. |
| 592 | pub fn leaf_op_count(&self) -> usize { |
no outgoing calls
no test coverage detected