Skip to main content

split_lines

Function split_lines 

Source
pub fn split_lines(blob: &[u8]) -> Vec<DiffLine<'_>>
Expand description

Split a blob into lines, preserving the exact bytes of each line.

Each returned DiffLine borrows from blob; its content includes the terminating \n. The returned vector is empty for an empty blob. A blob whose final byte is not \n yields a final line with has_newline == false — git’s “\ No newline at end of file” case.