Return the lines of code collected so far for this example. This is borrowed mutably because it may need to mutate the code lines based on the state accrued so far.
(&mut self)
| 807 | /// This is borrowed mutably because it may need to mutate the code lines |
| 808 | /// based on the state accrued so far. |
| 809 | fn code(&mut self) -> &[CodeExampleLine<'src>] { |
| 810 | match *self { |
| 811 | CodeExampleKind::Doctest(ref doctest) => &doctest.lines, |
| 812 | CodeExampleKind::Rst(ref mut litblock) => litblock.indented_code(), |
| 813 | CodeExampleKind::Markdown(ref fenced) => &fenced.lines, |
| 814 | } |
| 815 | } |
| 816 | |
| 817 | /// Consume this code example and return only the lines that have been |
| 818 | /// accrued so far. |