MCPcopy Create free account
hub / github.com/ElementsProject/lightning / find_bytes

Function find_bytes

plugins/rest-plugin/src/handlers.rs:39–41  ·  view source on GitHub ↗

Find the first occurrence of `needle` in `haystack`, or None.

(haystack: &[u8], needle: &[u8])

Source from the content-addressed store, hash-verified

37
38/// Find the first occurrence of `needle` in `haystack`, or None.
39fn find_bytes(haystack: &[u8], needle: &[u8]) -> Option<usize> {
40 haystack.windows(needle.len()).position(|w| w == needle)
41}
42
43/// Iteratively bound the element nesting depth of `s` without building a DOM
44/// or recursing, so it cannot itself overflow. Runs *before* roxmltree's

Callers 1

xml_nesting_okFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected