fn rsplit_once_any<'a, 'b>(
    text: &'a str,
    delimiters: &'b [&'static str],
) -> Option<(&'a str, &'static str, &'a str)> {
    let mut res = None;
    let mut best = 0;
    for &delim in delimiters {
        if let Some(pos) = text.rfind(delim) {
            if pos >= best {
                best = pos;
                res = Some((&text[..pos], delim, &text[pos + delim.len()..]));
            }
        }
    }
    res
}
/// Find the rightmost match of any of the delimiters and do a split.
Find the rightmost match of any of the delimiters and do a split.
Find the rightmost match of any of the delimiters and do a split .
fn rsplit_once_any<'a, 'b>(
    text: &'a str,
    delimiters: &'b [&'static str],
) -> Option<(&'a str, &'static str, &'a str)> {
    let mut res = None;
    let mut best = 0;
    for &delim in delimiters {
        if let Some(pos) = text.rfind(delim) {
            if pos >= best {
                best = pos;
                res = Some((&text[..pos], delim, &text[pos + delim.len()..]));
            }
        }
    }
    res
}
fn rsplit_once_any < ' a , ' b > ( text : & ' a str , delimiters : & ' b [ & ' static str ] , ) -> Option < ( & ' a str , & ' static str , & ' a str ) > { let mut res = None ; let mut best = 0 ; for & delim in delimiters { if let Some ( pos ) = text . rfind ( delim ) { if pos >= best { best = pos ; res = Some ( ( & text [ .. pos ] , delim , & text [ pos + delim . len ( ) .. ] ) ) ; } } } res }
Find the rightmost match of any of the delimiters and do a split.
Find the rightmost match of any of the delimiters and do a split .
text
&'a str
delimiters
&'b [&'static str]
text
&'a str
delimiters
&'b [&'static str]