pub fn metrics(content: &str) -> (u64, u64, u64)Expand description
Count lines, words, and characters of content.
Lines are counted wc-style (a final line without a trailing newline still
counts); words are whitespace-separated; characters are Unicode scalar values
and include newlines (like wc -m).
ยงExamples
use coding_tools::tree::metrics;
// 2 lines; words a, b, cd; 7 chars including both newlines.
assert_eq!(metrics("a b\ncd\n"), (2, 3, 7));
// a final line without a newline still counts as a line.
assert_eq!(metrics("one two"), (1, 2, 7));
assert_eq!(metrics(""), (0, 0, 0));