fn match_line(p: &str, s: &str) -> bool {
    let sww = p.starts_with(WILDCARD);
    let eww = p.ends_with(WILDCARD);
    if sww && eww {
        s.find(&p[WILDCARD.len()..p.len() - WILDCARD.len()])
            .is_some()
    } else if sww {
        s.ends_with(&p[WILDCARD.len()..])
    } else if eww {
        s.starts_with(&p[..p.len() - WILDCARD.len()])
    } else {
        p == s
    }
}
/// Does the line `s` match the pattern `p`? Note that both strings are expected to be trimed
/// before being passed to this function.
Does the line `s` match the pattern `p`. Note that both strings are expected to be trimed
before being passed to this function.
Does the line ` s ` match the pattern ` p ` . Note that both strings are expected to be trimed before being passed to this function .
fn match_line(p: &str, s: &str) -> bool {
    let sww = p.starts_with(WILDCARD);
    let eww = p.ends_with(WILDCARD);
    if sww && eww {
        s.find(&p[WILDCARD.len()..p.len() - WILDCARD.len()])
            .is_some()
    } else if sww {
        s.ends_with(&p[WILDCARD.len()..])
    } else if eww {
        s.starts_with(&p[..p.len() - WILDCARD.len()])
    } else {
        p == s
    }
}
fn match_line ( p : & str , s : & str ) -> bool { let sww = p . starts_with ( WILDCARD ) ; let eww = p . ends_with ( WILDCARD ) ; if sww && eww { s . find ( & p [ WILDCARD . len ( ) .. p . len ( ) - WILDCARD . len ( ) ] ) . is_some ( ) } else if sww { s . ends_with ( & p [ WILDCARD . len ( ) .. ] ) } else if eww { s . starts_with ( & p [ .. p . len ( ) - WILDCARD . len ( ) ] ) } else { p == s } }
Does the line `s` match the pattern `p`?
Does the line ` s ` match the pattern ` p ` ?
p
&str
s
&str
p
&str
s
&str