Skip to main content

without

Function without 

Source
pub fn without(text: &str, removed: &[Entry]) -> String
Expand description

The text with these entries removed, blank lines closed up at the seams.

Removal is by byte span out of the text as it was parsed, never by re-rendering what stays. Anything in the file spar did not write, a preamble, an entry in a shape spar does not recognise, an edit somebody made to a body, comes back out exactly as it went in.

Spans are sorted and merged first, so a caller may pass them in any order and may pass the same one twice. That is what makes it correct to rewrite the file once per entry against the original text: splicing a splice would shift every later offset.