We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5b721f5 commit a85c21cCopy full SHA for a85c21c
data-pipeline/src/pausable_worker.rs
@@ -163,12 +163,8 @@ mod tests {
163
runtime.block_on(async { pausable_worker.pause().await.unwrap() });
164
// Empty the message queue and get the last message
165
let mut next_message = 1;
166
- loop {
167
- if let Ok(message) = receiver.try_recv() {
168
- next_message = message + 1;
169
- } else {
170
- break;
171
- }
+ for message in receiver.try_iter() {
+ next_message = message + 1;
172
}
173
pausable_worker.start(&runtime).unwrap();
174
assert_eq!(receiver.recv().unwrap(), next_message);
0 commit comments