(rootfs: &Path, candidates: &[&str])
| 884 | } |
| 885 | |
| 886 | fn require_any_rootfs_path(rootfs: &Path, candidates: &[&str]) -> Result<(), String> { |
| 887 | if candidates |
| 888 | .iter() |
| 889 | .any(|candidate| rootfs.join(candidate.trim_start_matches('/')).exists()) |
| 890 | { |
| 891 | Ok(()) |
| 892 | } else { |
| 893 | Err(format!( |
| 894 | "prepared rootfs is missing one of: {}", |
| 895 | candidates.join(", ") |
| 896 | )) |
| 897 | } |
| 898 | } |
| 899 | |
| 900 | fn remove_rootfs_path(rootfs: &Path, relative: &str) -> Result<(), String> { |
| 901 | let path = rootfs.join(relative); |
no test coverage detected