Function minigrep_jondeaves::search[][src]

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

Finds all lines within a block of text that contain the query, this method is case-sensitive

Examples

let query = "duct";
let contents = "\
Rust:
safe, fast, productive.
Pick three.
Duct tape.";

assert_eq!(vec!["safe, fast, productive."], minigrep_jondeaves::search(query, contents));