pub fn count_lines(text: &str) -> u64
Lines in text, as str::lines counts them: a final line needs no newline, and an empty text has none.
text
str::lines