}
}
+/**
+Process text lines from the given reader and try to find the given pattern.
+*(This is just an example of inline documentation)*
+
+# Some random XML code
+
+``` xml
+<?xml version="1.0" encoding="UTF-8"?>
+<abc>
+ <asd />
+</abc>
+```
+*/
fn process_lines<T: BufRead + Sized>(reader: T, pattern_re: Regex) {
for (i, line_result) in reader.lines().enumerate() {
match line_result {
Ok(line) => {
let contains_substring = pattern_re.find(&line);
match contains_substring {
- Some(_) => println!("Found \"{}\" at line number {}", pattern_re, i + 1),
+ Some(_) => println!("Found \"{}\" in line number {}", pattern_re, i + 1),
None => (),
}
},