pub fn is_match(query: &Query, subject: &Text) -> bool {
    let query_iter = query.lowercase_iter().filter(|g| !is_optional(g));
    let mut subject_iter = subject.lowercase_iter();

    let mut query_count = 0;
    let mut subject_count = 0;
    let mut matching = 0;
    'query_loop: for query_grapheme in query_iter {
        query_count += 1;

        if subject_count == subject.len() {
            break 'query_loop;
        }

        'subject_loop: for subject_grapheme in &mut subject_iter {
            subject_count += 1;

            if query_grapheme == subject_grapheme {
                matching += 1;
                // this grapheme is inside the subject, we can move to the next one
                break 'subject_loop;
            }
        }
    }

    matching == query_count
}
/// Check whether a query is inside a subject or not
Check whether a query is inside a subject or not
Check whether a query is inside a subject or not
pub fn is_match(query: &Query, subject: &Text) -> bool {
    let query_iter = query.lowercase_iter().filter(|g| !is_optional(g));
    let mut subject_iter = subject.lowercase_iter();
    let mut query_count = 0;
    let mut subject_count = 0;
    let mut matching = 0;
    'query_loop: for query_grapheme in query_iter {
        query_count += 1;
        if subject_count == subject.len() {
            break 'query_loop;
        }
        'subject_loop: for subject_grapheme in &mut subject_iter {
            subject_count += 1;
            if query_grapheme == subject_grapheme {
                matching += 1;
                // this grapheme is inside the subject, we can move to the next one
                break 'subject_loop;
            }
        }
    }
    matching == query_count
}
pub fn is_match ( query : & Query , subject : & Text ) -> bool { let query_iter = query . lowercase_iter ( ) . filter ( | g | ! is_optional ( g ) ) ; let mut subject_iter = subject . lowercase_iter ( ) ; let mut query_count = 0 ; let mut subject_count = 0 ; let mut matching = 0 ; ' query_loop : for query_grapheme in query_iter { query_count += 1 ; if subject_count == subject . len ( ) { break ' query_loop ; } ' subject_loop : for subject_grapheme in & mut subject_iter { subject_count += 1 ; if query_grapheme == subject_grapheme { matching += 1 ; // this grapheme is inside the subject, we can move to the next one break ' subject_loop ; } } } matching == query_count }
Check whether a query is inside a subject or not
Check whether a query is inside a subject or not
query
&Query
subject
&Text