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

Function project_relative_path

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

Source from the content-addressed store, hash-verified

2879}
2880
2881fn project_relative_path(path: &str) -> Option<String> {
2882 let normalized = normalize_path(path);
2883 for marker in ["/tests/", "/src/", "/examples/"] {
2884 if let Some(index) = normalized.find(marker) {
2885 return Some(normalized[index + 1..].to_string());
2886 }
2887 }
2888 for prefix in ["tests/", "src/", "examples/"] {
2889 if normalized.starts_with(prefix) {
2890 return Some(normalized);
2891 }
2892 }
2893 None
2894}
2895
2896fn tests_relative_path(path: &str) -> Option<String> {
2897 let normalized = normalize_path(path);

Calls 4

normalize_pathFunction · 0.70
findMethod · 0.45
to_stringMethod · 0.45
starts_withMethod · 0.45

Tested by 1