[][src]Function paolo_minigrep::search

pub fn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str>

Filters lines that match the pattern.

Examples


let query = "duct";
let contents = "\
Rust:
safe, fast, productive.
Pick three.
Duct tape.";
assert_eq!(vec!["safe, fast, productive."],
           minigrep::search(query, contents));