diff --git a/src/daft-scan/src/scan_task_iters.rs b/src/daft-scan/src/scan_task_iters.rs index 586d8f5870..081aa7a292 100644 --- a/src/daft-scan/src/scan_task_iters.rs +++ b/src/daft-scan/src/scan_task_iters.rs @@ -98,9 +98,7 @@ impl Iterator for MergeByFileSize { }; if next_item.size_bytes().is_none() || !self.can_merge(&next_item) { - let curr_acc = self.accumulator.take().map(Ok); - self.accumulator = Some(next_item); - return curr_acc; + return self.accumulator.replace(next_item).map(Ok); } self.accumulator = Some(Arc::new(