Skip to content

Commit

Permalink
Trim down the manual Py wrapping too.
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian committed Jan 10, 2024
1 parent d808005 commit e2f2842
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -573,13 +573,10 @@ impl ListPy {
}
}

fn __iter__(slf: PyRef<'_, Self>) -> PyResult<Py<ListIterator>> {
Py::new(
slf.py(),
ListIterator {
inner: slf.inner.clone(),
},
)
fn __iter__(slf: PyRef<'_, Self>) -> ListIterator {
ListIterator {
inner: slf.inner.clone(),
}
}

fn __reversed__(&self) -> ListPy {
Expand Down Expand Up @@ -723,13 +720,10 @@ impl QueuePy {
.any(|r| r.unwrap_or(true))
}

fn __iter__(slf: PyRef<'_, Self>) -> PyResult<Py<QueueIterator>> {
Py::new(
slf.py(),
QueueIterator {
inner: slf.inner.clone(),
},
)
fn __iter__(slf: PyRef<'_, Self>) -> QueueIterator {
QueueIterator {
inner: slf.inner.clone(),
}
}

fn __len__(&self) -> usize {
Expand Down

0 comments on commit e2f2842

Please sign in to comment.