fn keyword_match<'a>(keywords: &'a [&'a str], remainder: &str) -> Option<&'a str> {
            keywords
                .iter()
                .find(|&kw| &remainder[..min(remainder.len(), kw.len())] == *kw)
                .map(|s| *s)
        }
// Check if any keyword in keywords is a prefix of the string
// return Some(match) for the first match
Check if any keyword in keywords is a prefix of the string
return Some(match) for the first match
Check if any keyword in keywords is a prefix of the string return Some ( match ) for the first match
fn keyword_match<'a>(keywords: &'a [&'a str], remainder: &str) -> Option<&'a str> {
            keywords
                .iter()
                .find(|&kw| &remainder[..min(remainder.len(), kw.len())] == *kw)
                .map(|s| *s)
        }
fn keyword_match < ' a > ( keywords : & ' a [ & ' a str ] , remainder : & str ) -> Option < & ' a str > { keywords . iter ( ) . find ( | & kw | & remainder [ .. min ( remainder . len ( ) , kw . len ( ) ) ] == * kw ) . map ( | s | * s ) }
Check if any keyword in keywords is a prefix of the string
return Some(match) for the first match
Check if any keyword in keywords is a prefix of the string return Some ( match ) for the first match
keywords
&'a [&'a str]
remainder
&str