pub fn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str>
Expand description
search the word in the text
ยงExample
let query = "duct";
let contents = "Rust: \nsafe, fast, productive.\n Pick three.";
assert_eq!(vec!["safe, fast, productive."], minigrep::search(query, contents));