| 656 | type Item = (usize, String); |
| 657 | |
| 658 | fn next(&mut self) -> Option<Self::Item> { |
| 659 | let item = if let Some(next) = self.next.take() { |
| 660 | next |
| 661 | } else { |
| 662 | self.read_one() |
| 663 | }; |
| 664 | if item.is_some() { |
| 665 | // Sync `consumed_raw_pos` with `raw_pos` only when the line is |
| 666 | // actually returned to an external caller. `peek()` advances |
| 667 | // `raw_pos` via `read_one()` without consuming, so updating |
| 668 | // `consumed_raw_pos` here keeps it pointing at the end of the most |
| 669 | // recently consumed line — even if a later line has been peeked. |
| 670 | self.consumed_raw_pos = self.raw_pos; |
| 671 | } |
| 672 | item |
| 673 | } |
| 674 | } |
| 675 | |
| 676 | fn is_sigil(c: Option<char>) -> bool { |