Skip to main content

excerpt_text_lines

Function excerpt_text_lines 

Source
pub fn excerpt_text_lines<'a>(
    text: &'a str,
    head: usize,
    tail: usize,
) -> TextLineExcerpt<'a>
Expand description

First head and last tail lines of text in a single pass.

Memory is O(head + tail), not O(total lines): large tool outputs stream through a tail-sized ring instead of materializing every line transiently.