rust/tests/ui/traits/suggest-dereferences/root-obligation.rs
Benoît du Garreau 772315de7c Remove generic lifetime parameter of trait Pattern
Use a GAT for `Searcher` associated type because this trait is always
implemented for every lifetime anyway.
2024-07-15 12:12:44 +02:00

14 lines
270 B
Rust

//@ run-rustfix
fn get_vowel_count(string: &str) -> usize {
string
.chars()
.filter(|c| "aeiou".contains(c))
//~^ ERROR the trait bound `&char: Pattern` is not satisfied
.count()
}
fn main() {
let _ = get_vowel_count("asdf");
}