1use std::io::BufRead;
2
3pub fn find_matches(reader: impl BufRead, pattern: &str, mut writer: impl std::io::Write) {
4 for line in reader.lines() {
5 if let Ok(line) = line {
6 if line.contains(pattern) {
7 writeln!(writer, "{}", line).ok();
8 }
9 }
10 }
11}