summaryrefslogtreecommitdiffstats
path: root/src/lib.rs
blob: c01823dc01bbe4d870277421f5cc1aa3d291becc (plain)
1
2
3
4
5
6
pub fn search<'a>(pattern: &str, contents: &'a str) -> Vec<&'a str> {
    contents
        .lines()
        .filter(|line| line.contains(pattern))
        .collect()
}