TODO: replace to SourceCode
(source: &str, loc: Option<SourceLocation>)
| 484 | |
| 485 | // TODO: replace to SourceCode |
| 486 | fn get_statement(source: &str, loc: Option<SourceLocation>) -> Option<String> { |
| 487 | let line = source |
| 488 | .split('\n') |
| 489 | .nth(loc?.line.to_zero_indexed())? |
| 490 | .trim_end_matches('\r') |
| 491 | .to_owned(); |
| 492 | Some(line + "\n") |
| 493 | } |
| 494 | |
| 495 | let statement = if let Some(source) = source { |
| 496 | get_statement(source, error.location()) |
nothing calls this directly
no test coverage detected