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

Function contains_ascii_word

ci/lint_cpp_rs/src/lib.rs:2592–2606  ·  view source on GitHub ↗
(code: &str, word: &str)

Source from the content-addressed store, hash-verified

2590}
2591
2592fn contains_ascii_word(code: &str, word: &str) -> bool {
2593 let bytes = code.as_bytes();
2594 let mut search_start = 0;
2595 while let Some(relative_pos) = code[search_start..].find(word) {
2596 let pos = search_start + relative_pos;
2597 let end = pos + word.len();
2598 search_start = end;
2599 if (pos == 0 || !is_ascii_word_byte(bytes[pos - 1]))
2600 && (end >= bytes.len() || !is_ascii_word_byte(bytes[end]))
2601 {
2602 return true;
2603 }
2604 }
2605 false
2606}
2607
2608fn banned_header_recommendation(header: &str) -> &'static str {
2609 BANNED_HEADER_RECOMMENDATIONS

Callers 1

check_file_contentMethod · 0.85

Calls 2

is_ascii_word_byteFunction · 0.85
findMethod · 0.45

Tested by

no test coverage detected