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

Function project_relative_guess

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

Source from the content-addressed store, hash-verified

2843}
2844
2845fn project_relative_guess(path: &str) -> String {
2846 let normalized = normalize_path(path);
2847 for marker in ["/src/", "/tests/", "/examples/"] {
2848 if let Some(index) = normalized.find(marker) {
2849 return normalized[index + 1..].to_string();
2850 }
2851 }
2852 for prefix in ["src/", "tests/", "examples/"] {
2853 if normalized.starts_with(prefix) {
2854 return normalized;
2855 }
2856 }
2857 normalized
2858}
2859
2860fn project_root_prefix_for_file(path: &str) -> String {
2861 let normalized = normalize_path(path);

Callers 1

check_file_contentMethod · 0.85

Calls 4

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

Tested by

no test coverage detected