diff --git a/rust/nucleotide-count/src/lib.rs b/rust/nucleotide-count/src/lib.rs index d6f36aa9..76f8261b 100644 --- a/rust/nucleotide-count/src/lib.rs +++ b/rust/nucleotide-count/src/lib.rs @@ -1,4 +1,4 @@ -use std::collections::{HashMap, HashSet}; +use std::collections::HashMap; pub fn count(nucleotide: char, dna: &str) -> Result { if !valid_nucleotide(nucleotide) { @@ -28,6 +28,5 @@ fn default_map() -> HashMap { } fn valid_nucleotide(c: char) -> bool { - let nucleotides = HashSet::from(['A', 'C', 'G', 'T']); - nucleotides.contains(&c) + matches!(c, 'A' | 'C' | 'G' | 'T') }