Skip to main content

capped_lines

Function capped_lines 

Source
fn capped_lines(raw: &str, cut_by_bytes: bool) -> FileLines
Expand description

The file’s lines, cut to the counts a frame can afford.

Two bounds, and a frame pays for both. The byte ceiling bounds the content, and this bounds the LINES: a file of very short lines reaches ten thousand long before a byte ceiling, and ten million Strings is a server-side allocation and a JSON answer nobody asked for. A line the byte bound cuts in half is dropped rather than carried in part, so every line answered is a line of the file.