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

Function project_root_prefix_for_file

ci/lint_cpp_rs/src/lib.rs:2860–2868  ·  view source on GitHub ↗
(path: &str)

Source from the content-addressed store, hash-verified

2858}
2859
2860fn project_root_prefix_for_file(path: &str) -> String {
2861 let normalized = normalize_path(path);
2862 for marker in ["/tests/", "/src/", "/examples/"] {
2863 if let Some(index) = normalized.find(marker) {
2864 return normalized[..index].to_string();
2865 }
2866 }
2867 String::new()
2868}
2869
2870fn join_project_path(root_prefix: &str, rel_path: &str) -> PathBuf {
2871 if root_prefix.is_empty() {

Callers 2

check_file_contentMethod · 0.85

Calls 3

normalize_pathFunction · 0.70
findMethod · 0.45
to_stringMethod · 0.45

Tested by 1