Rustacious way of checking if string ends with any suffix from a selection
You could use Iterator:any to write this in a succinct way:

fn string_ends_with_any(s: String, suffixes: Vec&lt;&amp;str&gt;) -&gt; bool {
    return suffixes.iter().any(|&amp;suffix| s.ends_with(suffix));
}


Because this pattern returns true on first match of the predicate:


for suffix in &amp;suffixes {
    if s.ends_with(suffix) {
        return true;
    }
}
false



Whether this is rustacious remains to be seen. I'm by no means an expert in Rust.