Find the first occurrence of `needle` in `haystack`, or None.
(haystack: &[u8], needle: &[u8])
| 37 | |
| 38 | /// Find the first occurrence of `needle` in `haystack`, or None. |
| 39 | fn 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 |