From c6b65c42cf1aee25afe2d2ccb60dfbc24030f2c8 Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Wed, 10 Nov 2021 01:38:35 +0300 Subject: [PATCH] feat(rust): add vowel count kata --- rust/tests/7_vowel_count.rs | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 rust/tests/7_vowel_count.rs diff --git a/rust/tests/7_vowel_count.rs b/rust/tests/7_vowel_count.rs new file mode 100644 index 0000000..42c0018 --- /dev/null +++ b/rust/tests/7_vowel_count.rs @@ -0,0 +1,8 @@ +fn get_count(string: &str) -> usize { + string.matches(&['a', 'e', 'i', 'o', 'u'][..]).count() +} + +#[test] +fn my_tests() { + assert_eq!(get_count("abracadabra"), 5); +}