From cc1ffbafe37ebed656ee016d45cc6db29336a581 Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Wed, 2 Oct 2024 16:14:03 +0200 Subject: [PATCH] delay mutability question to later (antoine giga happy) --- crates/store/re_dataframe2/src/query.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/store/re_dataframe2/src/query.rs b/crates/store/re_dataframe2/src/query.rs index ac1d21342ac2..1e11ff4c34d2 100644 --- a/crates/store/re_dataframe2/src/query.rs +++ b/crates/store/re_dataframe2/src/query.rs @@ -390,7 +390,7 @@ impl QueryHandle<'_> { /// ``` // // TODO(cmc): better/actual pagination - pub fn next_row(&mut self) -> Option>> { + pub fn next_row(&self) -> Option>> { re_tracing::profile_function!(); /// Temporary state used to resolve the streaming join for the current iteration. @@ -664,7 +664,7 @@ impl QueryHandle<'_> { /// /// See [`Self::next_row`] for more information. #[inline] - pub fn next_row_batch(&mut self) -> Option { + pub fn next_row_batch(&self) -> Option { Some(RecordBatch { schema: self.schema().clone(), data: ArrowChunk::new(self.next_row()?), @@ -675,13 +675,13 @@ impl QueryHandle<'_> { impl<'a> QueryHandle<'a> { /// Returns an iterator backed by [`Self::next_row`]. #[allow(clippy::should_implement_trait)] // we need an anonymous closure, this won't work - pub fn into_iter(mut self) -> impl Iterator>> + 'a { + pub fn into_iter(self) -> impl Iterator>> + 'a { std::iter::from_fn(move || self.next_row()) } /// Returns an iterator backed by [`Self::next_row_batch`]. #[allow(clippy::should_implement_trait)] // we need an anonymous closure, this won't work - pub fn into_batch_iter(mut self) -> impl Iterator + 'a { + pub fn into_batch_iter(self) -> impl Iterator + 'a { std::iter::from_fn(move || self.next_row_batch()) } }