Extract the (change_id, leaf_idx) tuple from a LeafOp, if it references an existing leaf. Insert ops don't carry an assigned LeafId (the ID is assigned during apply), so they return None. Delete, Replace, and Restore reference existing leaves.
(op: &atomic_core::crdt::LeafOp)
| 362 | /// Insert ops don't carry an assigned LeafId (the ID is assigned during apply), |
| 363 | /// so they return None. Delete, Replace, and Restore reference existing leaves. |
| 364 | fn leaf_op_id(op: &atomic_core::crdt::LeafOp) -> Option<(u64, u32)> { |
| 365 | op.leaf_id() |
| 366 | .map(|lid| (lid.change_id().get(), lid.leaf_idx())) |
| 367 | } |
no test coverage detected