Skip to content

Commit

Permalink
Minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
BooleanCat committed Nov 30, 2024
1 parent 7fa23f4 commit 41a6ecf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/aminoacidsequence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ impl AminoAcidSequence {
py: Python<'py>,
index_or_slice: IntOrSlice,
) -> PyResult<Bound<'py, PyAny>> {
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()
}
}
})
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/dnasequence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ impl DNASequence {
py: Python<'py>,
index_or_slice: IntOrSlice,
) -> PyResult<Bound<'py, PyAny>> {
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<bool> {
Expand Down
8 changes: 4 additions & 4 deletions src/rnasequence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ impl RNASequence {
py: Python<'py>,
index_or_slice: IntOrSlice,
) -> PyResult<Bound<'py, PyAny>> {
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<bool> {
Expand Down

0 comments on commit 41a6ecf

Please sign in to comment.