Notate the pattern string with carents (`^`) pointing at each span location. This only applies to spans that occur within a single line.
(&self)
| 209 | /// Notate the pattern string with carents (`^`) pointing at each span |
| 210 | /// location. This only applies to spans that occur within a single line. |
| 211 | fn notate(&self) -> String { |
| 212 | let mut notated = String::new(); |
| 213 | for (i, line) in self.pattern.lines().enumerate() { |
| 214 | if self.line_number_width > 0 { |
| 215 | notated.push_str(&self.left_pad_line_number(i + 1)); |
| 216 | notated.push_str(": "); |
| 217 | } else { |
| 218 | notated.push_str(" "); |
| 219 | } |
| 220 | notated.push_str(line); |
| 221 | notated.push('\n'); |
| 222 | if let Some(notes) = self.notate_line(i) { |
| 223 | notated.push_str(¬es); |
| 224 | notated.push('\n'); |
| 225 | } |
| 226 | } |
| 227 | notated |
| 228 | } |
| 229 | |
| 230 | /// Return notes for the line indexed at `i` (zero-based). If there are no |
| 231 | /// spans for the given line, then `None` is returned. Otherwise, an |
no test coverage detected