Function regex_minigrep::grep
[−]
[src]
pub fn grep(args: Vec<String>) -> Result<String, Box<Error>>
From an argument vector it returns a formatted string with the search results
Example
// Input test.txt contains: // This function will never return and will immediately // terminate the current process. The exit code is passed // // This Note that because this function never returns, and that // it terminates the process, no destructors on the current let args = !["/path/", "target_file.txt", "This"]; match regex_minigrep::grep(args) { Err(e) => { println!("Error while running MiniGrep: {}", e); process::exit(1); } Ok(content) => print!("{}", content), } // Output to the terminal will be: // This function will never return and will immediately // This Note that because this function never returns, and that