From 133bf47a6083dd72b991d0c72dacb30ebd3195f2 Mon Sep 17 00:00:00 2001 From: Orson Peters Date: Tue, 8 Oct 2024 12:38:38 +0200 Subject: [PATCH] refactor(rust): Workaround for rust-analyzer bug (#19134) --- .../src/executors/sinks/group_by/primitive/mod.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/crates/polars-pipe/src/executors/sinks/group_by/primitive/mod.rs b/crates/polars-pipe/src/executors/sinks/group_by/primitive/mod.rs index 8715dd6f3fa9..6199789336e3 100644 --- a/crates/polars-pipe/src/executors/sinks/group_by/primitive/mod.rs +++ b/crates/polars-pipe/src/executors/sinks/group_by/primitive/mod.rs @@ -458,10 +458,11 @@ where fn finalize(&mut self, _context: &PExecutionContext) -> PolarsResult { let dfs = self.pre_finalize()?; let payload = if self.ooc_state.ooc { - let mut iot = self.ooc_state.io_thread.lock().unwrap(); - // make sure that we reset the shared states - // the OOC group_by will call split as well and it should - // not send continue spilling to disk + let mut guard = self.ooc_state.io_thread.lock().unwrap(); + // Type hint fixes rust-analyzer thinking .take() is an iterator method. + let iot: &mut Option<_> = &mut *guard; + // Make sure that we reset the shared states. The OOC group_by will + // call split as well and it should not send continue spilling to disk. let iot = iot.take().unwrap(); self.ooc_state.ooc = false;