(input: &str)
| 85 | const CHARS_PER_TOKEN: usize = 4; |
| 86 | |
| 87 | pub fn estimate(input: &str) -> usize { |
| 88 | if input.is_empty() { |
| 89 | return 0; |
| 90 | } |
| 91 | input.len() / CHARS_PER_TOKEN |
| 92 | } |
| 93 | |
| 94 | pub fn estimate_messages(messages: &[&str]) -> usize { |
| 95 | messages.iter().map(|m| estimate(m)).sum() |
no test coverage detected