Skip to content

Commit

Permalink
Use a closure instead of a labelled block for MSRV compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamreichold committed Dec 14, 2023
1 parent 15f5e8b commit b25a399
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,10 +365,10 @@ impl<'py> Python<'py> {

static THREADS: Mutex<Vec<SyncSender<Task>>> = const_mutex(Vec::new());

let task_sender = 'dispatch: {
let dispatch = move || {
while let Some(task_sender) = THREADS.lock().pop() {
match task_sender.send(task) {
Ok(()) => break 'dispatch task_sender,
Ok(()) => return task_sender,
Err(SendError(same_task)) => task = same_task,
}
}
Expand All @@ -392,6 +392,8 @@ impl<'py> Python<'py> {
task_sender
};

let task_sender = dispatch();

// 3. Wait for completion and check result
let result = result_receiver
.recv()
Expand Down

0 comments on commit b25a399

Please sign in to comment.