From f7f7cd5bb97ff0b822b7262489f75ac986904e5b Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Mon, 19 Aug 2024 19:15:27 -0400 Subject: [PATCH] repl: Don't prefix free variables with `_` (#16494) This PR is a small refactor to remove the leading `_` for some free variables, as this unintentionally marks them as unused to the compiler. While the fields on the struct _are_ unused, the free variables should participate in usage tracking, as we want to make sure they get stored on the struct. Release Notes: - N/A --- crates/repl/src/kernels.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/repl/src/kernels.rs b/crates/repl/src/kernels.rs index a476419654..a10299d364 100644 --- a/crates/repl/src/kernels.rs +++ b/crates/repl/src/kernels.rs @@ -261,7 +261,7 @@ impl RunningKernel { messages_rx.push(control_reply_rx); messages_rx.push(shell_reply_rx); - let _iopub_task = cx.background_executor().spawn({ + let iopub_task = cx.background_executor().spawn({ async move { while let Ok(message) = iopub_socket.read().await { iopub.send(message).await?; @@ -274,7 +274,7 @@ impl RunningKernel { futures::channel::mpsc::channel(100); let (mut shell_request_tx, mut shell_request_rx) = futures::channel::mpsc::channel(100); - let _routing_task = cx.background_executor().spawn({ + let routing_task = cx.background_executor().spawn({ async move { while let Some(message) = request_rx.next().await { match message.content { @@ -292,7 +292,7 @@ impl RunningKernel { } }); - let _shell_task = cx.background_executor().spawn({ + let shell_task = cx.background_executor().spawn({ async move { while let Some(message) = shell_request_rx.next().await { shell_socket.send(message).await.ok(); @@ -303,7 +303,7 @@ impl RunningKernel { } }); - let _control_task = cx.background_executor().spawn({ + let control_task = cx.background_executor().spawn({ async move { while let Some(message) = control_request_rx.next().await { control_socket.send(message).await.ok(); @@ -319,10 +319,10 @@ impl RunningKernel { process, request_tx, working_directory, - _shell_task, - _iopub_task, - _control_task, - _routing_task, + _shell_task: shell_task, + _iopub_task: iopub_task, + _control_task: control_task, + _routing_task: routing_task, connection_path, execution_state: ExecutionState::Busy, kernel_info: None,