Skip to content

Commit 090ebdd

Browse files
author
Andrew J Westlake
committed
Satisfied clippy
1 parent 42d2d50 commit 090ebdd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/generic.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,11 @@ where
257257
Ok(fut) => match fut.await {
258258
Ok(item) => Ok(item),
259259
Err(e) => {
260-
if Python::with_gil(|py| {
260+
let stop_iter = Python::with_gil(|py| {
261261
e.is_instance::<pyo3::exceptions::PyStopAsyncIteration>(py)
262-
}) {
262+
});
263+
264+
if stop_iter {
263265
// end the iteration
264266
break;
265267
} else {
@@ -270,7 +272,7 @@ where
270272
Err(e) => Err(e),
271273
};
272274

273-
if let Err(_) = tx.send(item).await {
275+
if tx.send(item).await.is_err() {
274276
// receiving side was dropped
275277
break;
276278
}

0 commit comments

Comments
 (0)