Skip to main content

splice

Function splice 

Source
pub fn splice(text: &str, front: usize, back: usize, place: Elided) -> Cut
Expand description

The cut a caller assembles: the bytes before front, the marker, and the bytes from back on.

Both ends move to a character boundary — back for front, forward for back — and the far end is never left behind the near one. The removed count is then the distance between two positions the text itself reported, which is what makes the marker’s number true by construction, and why the count and the survivors always add back up into the input.