pub(crate) fn match_vec(plines: &[&str], s: &str) -> bool {
    debug_assert!(plines.is_empty() || !plines[0].is_empty());
    debug_assert!(plines.is_empty() || !plines[plines.len() - 1].is_empty());
    let slines = s.trim().lines().map(|x| x.trim()).collect::<Vec<_>>();

    let mut pi = 0;
    let mut si = 0;

    while pi < plines.len() && si < slines.len() {
        if plines[pi] == WILDCARD {
            pi += 1;
            if pi == plines.len() {
                return true;
            }
            if plines[pi] == WILDCARD {
                fatal(&format!(
                    "Can't have '{}' on two consecutive lines.",
                    WILDCARD
                ));
            }
            while si < slines.len() && !match_line(&plines[pi], slines[si]) {
                si += 1;
            }
        } else if match_line(&plines[pi], slines[si]) {
            pi += 1;
            si += 1;
        } else {
            return false;
        }
    }
    (pi == plines.len() && si == slines.len())
        || (pi + 1 == plines.len() && plines[pi] == WILDCARD && si == slines.len())
}
/// Does `s` conform to the fuzzy pattern `pattern`? Note that `plines` is expected not to start or
/// end with blank lines, and each line is expected to be `trim`ed.
Does `s` conform to the fuzzy pattern `pattern`. Note that `plines` is expected not to start or
end with blank lines, and each line is expected to be `trim`ed.
Does ` s ` conform to the fuzzy pattern ` pattern ` . Note that ` plines ` is expected not to start or end with blank lines and each line is expected to be ` trim ` ed .
pub(crate) fn match_vec(plines: &[&str], s: &str) -> bool {
    debug_assert!(plines.is_empty() || !plines[0].is_empty());
    debug_assert!(plines.is_empty() || !plines[plines.len() - 1].is_empty());
    let slines = s.trim().lines().map(|x| x.trim()).collect::<Vec<_>>();
    let mut pi = 0;
    let mut si = 0;
    while pi < plines.len() && si < slines.len() {
        if plines[pi] == WILDCARD {
            pi += 1;
            if pi == plines.len() {
                return true;
            }
            if plines[pi] == WILDCARD {
                fatal(&format!(
                    "Can't have '{}' on two consecutive lines.",
                    WILDCARD
                ));
            }
            while si < slines.len() && !match_line(&plines[pi], slines[si]) {
                si += 1;
            }
        } else if match_line(&plines[pi], slines[si]) {
            pi += 1;
            si += 1;
        } else {
            return false;
        }
    }
    (pi == plines.len() && si == slines.len())
        || (pi + 1 == plines.len() && plines[pi] == WILDCARD && si == slines.len())
}
pub ( crate ) fn match_vec ( plines : & [ & str ] , s : & str ) -> bool { debug_assert ! ( plines is_empty ( ) plines [ 0 ] is_empty ( ) ) ; debug_assert ! ( plines is_empty ( ) plines [ plines len ( ) 1 ] is_empty ( ) ) ; let slines = s . trim ( ) . lines ( ) . map ( | x | x . trim ( ) ) . collect :: < Vec < _ > > ( ) ; let mut pi = 0 ; let mut si = 0 ; while pi < plines . len ( ) && si < slines . len ( ) { if plines [ pi ] == WILDCARD { pi += 1 ; if pi == plines . len ( ) { return true ; } if plines [ pi ] == WILDCARD { fatal ( & format ! ( " " WILDCARD ) ) ; } while si < slines . len ( ) && ! match_line ( & plines [ pi ] , slines [ si ] ) { si += 1 ; } } else if match_line ( & plines [ pi ] , slines [ si ] ) { pi += 1 ; si += 1 ; } else { return false ; } } ( pi == plines . len ( ) && si == slines . len ( ) ) || ( pi + 1 == plines . len ( ) && plines [ pi ] == WILDCARD && si == slines . len ( ) ) }
Does `s` conform to the fuzzy pattern `pattern`?
Does ` s ` conform to the fuzzy pattern ` pattern ` ?
plines
&[&str]
s
&str
plines
&[&str]
s
&str