pub fn search<'a>(pattern: &str, contents: &'a str) -> Vec<&'a str> { contents .lines() .filter(|line| line.contains(pattern)) .collect() }