(path: &str, project_root: &Path, subpath: &str)
| 1794 | } |
| 1795 | |
| 1796 | fn is_under_project_subpath(path: &str, project_root: &Path, subpath: &str) -> bool { |
| 1797 | let normalized_path = normalize_path(path); |
| 1798 | let normalized_root = normalize_path(&path_to_string(project_root)); |
| 1799 | let subpath = subpath.trim_matches('/'); |
| 1800 | normalized_path == format!("{normalized_root}/{subpath}") |
| 1801 | || normalized_path.starts_with(&format!("{normalized_root}/{subpath}/")) |
| 1802 | || normalized_path == subpath |
| 1803 | || normalized_path.starts_with(&format!("{subpath}/")) |
| 1804 | } |
| 1805 | |
| 1806 | fn ends_with_any(path: &str, suffixes: &[&str]) -> bool { |
| 1807 | suffixes.iter().any(|suffix| path.ends_with(suffix)) |
no test coverage detected