mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
14 lines
267 B
Rust
14 lines
267 B
Rust
// run-rustfix
|
|
|
|
fn get_vowel_count(string: &str) -> usize {
|
|
string
|
|
.chars()
|
|
.filter(|c| "aeiou".contains(*c))
|
|
//~^ ERROR expected a `Fn<(char,)>` closure, found `char`
|
|
.count()
|
|
}
|
|
|
|
fn main() {
|
|
let _ = get_vowel_count("asdf");
|
|
}
|