MCPcopy Create free account
hub / github.com/FastLED/FastLED / is_under_project_subpath

Function is_under_project_subpath

ci/lint_cpp_rs/src/lib.rs:1796–1804  ·  view source on GitHub ↗
(path: &str, project_root: &Path, subpath: &str)

Source from the content-addressed store, hash-verified

1794}
1795
1796fn 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
1806fn ends_with_any(path: &str, suffixes: &[&str]) -> bool {
1807 suffixes.iter().any(|suffix| path.ends_with(suffix))

Callers 2

should_process_fileMethod · 0.85
scope_matchesMethod · 0.85

Calls 3

path_to_stringFunction · 0.85
normalize_pathFunction · 0.70
starts_withMethod · 0.45

Tested by

no test coverage detected