diff --git a/src/queue.rs b/src/queue.rs index 17bd0bd..b4ed9e6 100644 --- a/src/queue.rs +++ b/src/queue.rs @@ -452,7 +452,7 @@ where loop { tracing::trace!("heartbeat: looping"); count += 1; - count = count % yield_limit; + count %= yield_limit; // yield every 8 iterations to be kind to other tasks if count == 0 { diff --git a/src/stream.rs b/src/stream.rs index f03ec31..65b6547 100644 --- a/src/stream.rs +++ b/src/stream.rs @@ -83,7 +83,7 @@ where tracing::trace!("from_iterator: looping"); count += 1; - count = count % yield_count; + count %= yield_count; yielder.yield_(res).await;