Guest User

Untitled

a guest
Jun 22nd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. pub fn search<'a>(query: &str, contents: &'a str) -> Vec<String> {
  2. let mut results = Vec::new();
  3.  
  4. for (lineno, line) in contents.lines().enumerate() {
  5. if line.contains(query) {
  6. let sTemp: String = lineno.to_string();
  7. results.push(sTemp.push_str(line));
  8. }
  9. }
  10. return results;
Add Comment
Please, Sign In to add comment