From fc86358fe3a7117b7c4448c6ec6a37b3666faaf4 Mon Sep 17 00:00:00 2001 From: Steve Wooster Date: Tue, 17 Oct 2023 13:37:44 -0700 Subject: [PATCH] Slight refactor Makes ambiguous -> concrete conversion better mirror concrete -> ambiguous conversion. --- src/nucleotide.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/nucleotide.rs b/src/nucleotide.rs index 2678606..e32a986 100644 --- a/src/nucleotide.rs +++ b/src/nucleotide.rs @@ -447,11 +447,8 @@ impl TryFrom for Codon { #[inline(always)] fn try_from(codon: CodonAmbiguous) -> Result { - Ok(Self([ - codon.0[0].try_into()?, - codon.0[1].try_into()?, - codon.0[2].try_into()?, - ])) + let [nuc0, nuc1, nuc2] = codon.0.map(TryInto::try_into); + Ok([nuc0?, nuc1?, nuc2?].into()) } }