tacoda_grrs/lib.rs
1// By convention, cargo will look for integration tests in the tests/
2// directory. Similarly, it will look for benchmarks in benches/, and
3// examples in examples/. These conventions also extend to your main
4// source code: libraries have a src/lib.rs file, the main binary is
5// src/main.rs, or, if there are multiple binaries, cargo expects them
6// to be in src/bin/<name>.rs. Following these conventions will make
7// your code base more discoverable by people used to reading Rust code.
8
9pub fn find_matches(content: &str, pattern: &str, mut writer: impl std::io::Write) {
10 for line in content.lines() {
11 if line.contains(pattern) {
12 writeln!(writer, "{}", line);
13 }
14 }
15}