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

Method to_insert_index

atomic-core/src/crdt/apply/order.rs:70–76  ·  view source on GitHub ↗
(&self, len: usize)

Source from the content-addressed store, hash-verified

68 /// For use with `Vec::insert()`.
69 #[inline]
70 pub fn to_insert_index(&self, len: usize) -> usize {
71 match self {
72 InsertPosition::Start => 0,
73 InsertPosition::After(idx) => idx + 1,
74 InsertPosition::End => len,
75 }
76 }
77
78 /// Returns `true` if this is an insertion at the start.
79 #[inline]

Callers 1

insertMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected