(original: &str, updated: &str)
| 428 | } |
| 429 | |
| 430 | fn make_patch(original: &str, updated: &str) -> Vec<StructuredPatchHunk> { |
| 431 | let mut lines = Vec::new(); |
| 432 | for line in original.lines() { |
| 433 | lines.push(format!("-{line}")); |
| 434 | } |
| 435 | for line in updated.lines() { |
| 436 | lines.push(format!("+{line}")); |
| 437 | } |
| 438 | |
| 439 | vec![StructuredPatchHunk { |
| 440 | old_start: 1, |
| 441 | old_lines: original.lines().count(), |
| 442 | new_start: 1, |
| 443 | new_lines: updated.lines().count(), |
| 444 | lines, |
| 445 | }] |
| 446 | } |
| 447 | |
| 448 | fn normalize_path(path: &str) -> io::Result<PathBuf> { |
| 449 | let candidate = if Path::new(path).is_absolute() { |
no test coverage detected