pub(crate) fn count_nl(s: &str) -> usize
Count the number of newlines that appear in s.
This is potentially one less than the number of lines in s, if the final line is not terminated, but that’s okay for our uses here.