()
| 2 | use std::io::{self, BufRead, BufReader}; |
| 3 | |
| 4 | fn main() -> io::Result<()> { |
| 5 | let args: Vec<String> = std::env::args().collect(); |
| 6 | |
| 7 | let file = File::open(&args[1])?; |
| 8 | let reader = BufReader::new(file); |
| 9 | |
| 10 | let mut found = 0usize; |
| 11 | for line in reader.lines() { |
| 12 | let line = line?; |
| 13 | let elems: Vec<&str> = line.split(',').collect(); |
| 14 | if elems[1] == "Tanzania" { |
| 15 | found += 1; |
| 16 | } |
| 17 | } |
| 18 | println!("found {} sales for Tanzania", found); |
| 19 | Ok(()) |
| 20 | } |
nothing calls this directly
no outgoing calls
no test coverage detected