2022-03-26 23:01:29 +00:00
|
|
|
//@ run-rustfix
|
|
|
|
|
|
|
|
|
|
fn get_vowel_count(string: &str) -> usize {
|
|
|
|
|
string
|
|
|
|
|
.chars()
|
|
|
|
|
.filter(|c| "aeiou".contains(*c))
|
2024-07-08 14:30:17 +02:00
|
|
|
//~^ ERROR the trait bound `&char: Pattern` is not satisfied
|
2022-03-26 23:01:29 +00:00
|
|
|
.count()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
let _ = get_vowel_count("asdf");
|
|
|
|
|
}
|