Skip to content

Commit

Permalink
Slight refactor
Browse files Browse the repository at this point in the history
Makes ambiguous -> concrete conversion better mirror concrete -> ambiguous conversion.
  • Loading branch information
swooster committed Oct 17, 2023
1 parent a0f2e25 commit fc86358
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/nucleotide.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,11 +447,8 @@ impl TryFrom<CodonAmbiguous> for Codon {

#[inline(always)]
fn try_from(codon: CodonAmbiguous) -> Result<Self, Self::Error> {
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())
}
}

Expand Down

0 comments on commit fc86358

Please sign in to comment.