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

Function header_exists_for_file

ci/lint_cpp_rs/src/lib.rs:2457–2470  ·  view source on GitHub ↗
(file_path: &str, include_path: &str)

Source from the content-addressed store, hash-verified

2455}
2456
2457fn header_exists_for_file(file_path: &str, include_path: &str) -> bool {
2458 if is_relative_include_path(include_path) || is_external_sdk_header(include_path) {
2459 return true;
2460 }
2461
2462 let normalized_path = normalize_path(file_path);
2463 let project_root = if let Some(index) = normalized_path.find("/src/") {
2464 PathBuf::from(&normalized_path[..index])
2465 } else {
2466 PathBuf::from(".")
2467 };
2468
2469 project_root.join("src").join(include_path).exists()
2470}
2471
2472fn typo_include_suggestion(include_path: &str) -> Option<&'static str> {
2473 TYPO_INCLUDE_PREFIXES

Callers 1

check_file_contentMethod · 0.85

Calls 4

is_relative_include_pathFunction · 0.85
is_external_sdk_headerFunction · 0.70
normalize_pathFunction · 0.70
findMethod · 0.45

Tested by

no test coverage detected