Skip to content

Commit

Permalink
Add conversions to Expansion
Browse files Browse the repository at this point in the history
  • Loading branch information
swooster committed Jan 29, 2024
1 parent 9ca2659 commit 3379261
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/expansions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,24 @@ impl Expansion {
}
}

impl From<DnaSequenceStrict> for Expansion {
fn from(dna: DnaSequenceStrict) -> Self {
dna.as_slice().into()
}
}

impl From<&[Nucleotide]> for Expansion {
fn from(dna: &[Nucleotide]) -> Self {
Self(Arc::from(dna))
}
}

impl From<Arc<[Nucleotide]>> for Expansion {
fn from(dna: Arc<[Nucleotide]>) -> Self {
Self(dna)
}
}

impl From<Expansion> for DnaSequenceStrict {
fn from(expansion: Expansion) -> Self {
expansion.to_dna()
Expand Down

0 comments on commit 3379261

Please sign in to comment.