I need to find out if a slice contains an element that satisfies some condition. I know that str::contains takes a Pattern, so I at first tried this:
my_list.contains(|el| my_condition(el)); // yes, I know this particular case can be written point-free
but that doesn't work since slice::contains takes an &T. Why is that and what should I do instead?