Returns the code collected in this example as a sequence of lines. The lines returned have the minimum indentation stripped from their prefix in-place. Based on the definition of minimum indentation, this implies there is at least one line in the slice returned with no whitespace prefix.
(&mut self)
| 1096 | /// implies there is at least one line in the slice returned with no |
| 1097 | /// whitespace prefix. |
| 1098 | fn indented_code(&mut self) -> &[CodeExampleLine<'src>] { |
| 1099 | let Some(min_indent) = self.min_indent else { |
| 1100 | return &[]; |
| 1101 | }; |
| 1102 | for line in &mut self.lines { |
| 1103 | line.code = if line.original.line.trim().is_empty() { |
| 1104 | "" |
| 1105 | } else { |
| 1106 | min_indent.trim_start_str(line.original.line) |
| 1107 | }; |
| 1108 | } |
| 1109 | &self.lines |
| 1110 | } |
| 1111 | |
| 1112 | /// Attempts to add the given line from a docstring to the reStructuredText |
| 1113 | /// code snippet being collected. |
no test coverage detected