pub(crate) fn matches_naive(
        reverse: bool,
        haystack: &[u8],
        needle: &[u8],
        mut search: impl FnMut(&[u8], &[u8]) -> Option<usize>,
    ) -> bool {
        if reverse {
            naive_rfind(haystack, needle) == search(haystack, needle)
        } else {
            naive_find(haystack, needle) == search(haystack, needle)
        }
    }
/// Check that naive substring search matches the result of the given search
/// algorithm.
Check that naive substring search matches the result of the given search
algorithm.
Check that naive substring search matches the result of the given search algorithm .
pub(crate) fn matches_naive(
        reverse: bool,
        haystack: &[u8],
        needle: &[u8],
        mut search: impl FnMut(&[u8], &[u8]) -> Option<usize>,
    ) -> bool {
        if reverse {
            naive_rfind(haystack, needle) == search(haystack, needle)
        } else {
            naive_find(haystack, needle) == search(haystack, needle)
        }
    }
pub ( crate ) fn matches_naive ( reverse : bool , haystack : & [ u8 ] , needle : & [ u8 ] , mut search : impl FnMut ( & [ u8 ] , & [ u8 ] ) -> Option < usize > , ) -> bool { if reverse { naive_rfind ( haystack , needle ) == search ( haystack , needle ) } else { naive_find ( haystack , needle ) == search ( haystack , needle ) } }
Check that naive substring search matches the result of the given search
algorithm.
Check that naive substring search matches the result of the given search algorithm .
reverse
bool
haystack
&[u8]
needle
&[u8]
search
impl FnMut(&[u8], &[u8]) -> Option<usize>
reverse
bool
haystack
&[u8]
needle
&[u8]
search
impl FnMut(&[u8], &[u8]) -> Option<usize>