Last active
December 29, 2015 09:12
-
-
Save dbrgn/fd31964624bbf4942a14 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct Tokenizer<R: BufRead> { | |
| reader: R, | |
| current_line: String, | |
| } | |
| impl<R> Iterator for Tokenizer<R> where R: BufRead { | |
| type Item = &'a str; | |
| fn next<'a>(&'a mut self) -> Option<&'a str> { | |
| self.current_line.clear(); | |
| let bytes_read = self.reader.read_line(&mut self.current_line).unwrap(); | |
| match bytes_read { | |
| 0 => None, | |
| _ => Some(&self.current_line), | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| src/main.rs:37:18: 37:20 error: use of undeclared lifetime name `'a` [E0261] | |
| src/main.rs:37 type Item = &'a str; | |
| ^~ | |
| src/main.rs:37:18: 37:20 help: run `rustc --explain E0261` to see a detailed explanation | |
| error: aborting due to previous error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment