From e2f2842eb308f57c696795bb73862a106a74713b Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Wed, 10 Jan 2024 15:25:44 -0500 Subject: [PATCH] Trim down the manual Py wrapping too. --- src/lib.rs | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 88c2ab6..b3afad7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -573,13 +573,10 @@ impl ListPy { } } - fn __iter__(slf: PyRef<'_, Self>) -> PyResult> { - Py::new( - slf.py(), - ListIterator { - inner: slf.inner.clone(), - }, - ) + fn __iter__(slf: PyRef<'_, Self>) -> ListIterator { + ListIterator { + inner: slf.inner.clone(), + } } fn __reversed__(&self) -> ListPy { @@ -723,13 +720,10 @@ impl QueuePy { .any(|r| r.unwrap_or(true)) } - fn __iter__(slf: PyRef<'_, Self>) -> PyResult> { - Py::new( - slf.py(), - QueueIterator { - inner: slf.inner.clone(), - }, - ) + fn __iter__(slf: PyRef<'_, Self>) -> QueueIterator { + QueueIterator { + inner: slf.inner.clone(), + } } fn __len__(&self) -> usize {