mykatas/rust/tests/7_vowel_count.rs

8 lines
171 B
Rust

fn get_count(string: &str) -> usize {
string.matches(&['a', 'e', 'i', 'o', 'u'][..]).count()
}
#[test]
fn my_tests() {
assert_eq!(get_count("abracadabra"), 5);
}