diff --git a/src/aminoacidsequence.rs b/src/aminoacidsequence.rs index 14d83b1..5c995e9 100644 --- a/src/aminoacidsequence.rs +++ b/src/aminoacidsequence.rs @@ -66,12 +66,12 @@ impl AminoAcidSequence { py: Python<'py>, index_or_slice: IntOrSlice, ) -> PyResult> { - match self.getitem(index_or_slice)? { - MemberOrMembers::Member(member) => Ok(member.into_pyobject(py)?.into_any()), + Ok(match self.getitem(index_or_slice)? { + MemberOrMembers::Member(member) => member.into_pyobject(py)?.into_any(), MemberOrMembers::Sequence(sequence) => { - Ok(Self::from(sequence).into_pyobject(py)?.into_any()) + Self::from(sequence).into_pyobject(py)?.into_any() } - } + }) } } diff --git a/src/dnasequence.rs b/src/dnasequence.rs index 3cc7b37..0e064ca 100644 --- a/src/dnasequence.rs +++ b/src/dnasequence.rs @@ -86,12 +86,12 @@ impl DNASequence { py: Python<'py>, index_or_slice: IntOrSlice, ) -> PyResult> { - match self.getitem(index_or_slice)? { - MemberOrMembers::Member(base) => Ok(base.into_pyobject(py)?.into_any()), + Ok(match self.getitem(index_or_slice)? { + MemberOrMembers::Member(base) => base.into_pyobject(py)?.into_any(), MemberOrMembers::Sequence(sequence) => { - Ok(Self::from(sequence).into_pyobject(py)?.into_any()) + Self::from(sequence).into_pyobject(py)?.into_any() } - } + }) } fn __contains__(&self, sequence: DNASequenceInput) -> PyResult { diff --git a/src/rnasequence.rs b/src/rnasequence.rs index b0bb74c..e6e91e8 100644 --- a/src/rnasequence.rs +++ b/src/rnasequence.rs @@ -123,12 +123,12 @@ impl RNASequence { py: Python<'py>, index_or_slice: IntOrSlice, ) -> PyResult> { - match self.getitem(index_or_slice)? { - MemberOrMembers::Member(member) => Ok(member.into_pyobject(py)?.into_any()), + Ok(match self.getitem(index_or_slice)? { + MemberOrMembers::Member(member) => member.into_pyobject(py)?.into_any(), MemberOrMembers::Sequence(sequence) => { - Ok(Self::from(sequence).into_pyobject(py)?.into_any()) + Self::from(sequence).into_pyobject(py)?.into_any() } - } + }) } fn __contains__(&self, sequence: RNASequenceInput) -> PyResult {