mykatas/rust/tests/7_vowel_count.rs

9 lines
171 B
Rust
Raw Normal View History

2021-11-10 01:38:35 +03:00
fn get_count(string: &str) -> usize {
string.matches(&['a', 'e', 'i', 'o', 'u'][..]).count()
}
#[test]
fn my_tests() {
assert_eq!(get_count("abracadabra"), 5);
}