diff --git a/src/expansions.rs b/src/expansions.rs index 81e7316..911a706 100644 --- a/src/expansions.rs +++ b/src/expansions.rs @@ -133,6 +133,24 @@ impl Expansion { } } +impl From 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> for Expansion { + fn from(dna: Arc<[Nucleotide]>) -> Self { + Self(dna) + } +} + impl From for DnaSequenceStrict { fn from(expansion: Expansion) -> Self { expansion.to_dna()