(root: &Path, abs: &Path)
| 449 | } |
| 450 | |
| 451 | fn rel_under_root(root: &Path, abs: &Path) -> Option<String> { |
| 452 | let stripped = abs.strip_prefix(root).ok()?; |
| 453 | if stripped.as_os_str().is_empty() { |
| 454 | return None; |
| 455 | } |
| 456 | if stripped.components().any(|component| { |
| 457 | matches!( |
| 458 | component, |
| 459 | Component::ParentDir | Component::RootDir | Component::Prefix(_) |
| 460 | ) |
| 461 | }) { |
| 462 | return None; |
| 463 | } |
| 464 | Some(stripped.to_string_lossy().replace('\\', "/")) |
| 465 | } |
| 466 | |
| 467 | fn text_field(value: &Value, keys: &[&str]) -> Option<String> { |
| 468 | keys.iter() |
no test coverage detected