add_span

Function add_span 

Source
pub fn add_span<'a>(
    code: &'a Code,
    span: Span<'a>,
    snippets: &mut Vec<Snippet<'a>>,
)
Expand description

Adds a span to the appropriate snippet in the given vector.

This is a utility function used in constructing a vector of snippets with annotated spans.

If a snippet for the given code already exists in the vector, this function adds the span to that snippet. Otherwise, it creates a new snippet with the given code and span, and appends it to the vector.