(path: &str, root: &Path)
| 605 | } |
| 606 | |
| 607 | fn relativize(path: &str, root: &Path) -> String { |
| 608 | let candidate = Path::new(path); |
| 609 | if candidate.is_absolute() { |
| 610 | if let Ok(relative) = candidate.strip_prefix(root) { |
| 611 | return relative.display().to_string(); |
| 612 | } |
| 613 | return path.to_string(); |
| 614 | } |
| 615 | path.to_string() |
| 616 | } |
| 617 | |
| 618 | /// `atomic record` over Record — every form. The message composes |
| 619 | /// client-side with the SAME editor/prompt flow the local body uses |