This is an automated email from the ASF dual-hosted git repository.

jerry-024 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/paimon-rust.git


The following commit(s) were added to refs/heads/main by this push:
     new 96a3f7b2 fix: satisfy Rust 1.98 chunks lint (#750)
96a3f7b2 is described below

commit 96a3f7b21f7e42d3907127132584b427666efa86
Author: shyjsarah <[email protected]>
AuthorDate: Thu Aug 27 10:42:28 2026 +0800

    fix: satisfy Rust 1.98 chunks lint (#750)
---
 crates/integrations/datafusion/src/hybrid_search.rs | 6 ++++--
 crates/paimon/src/spec/murmur_hash.rs               | 4 ++--
 crates/paimon/src/table/vector_search_builder.rs    | 4 ++--
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/crates/integrations/datafusion/src/hybrid_search.rs 
b/crates/integrations/datafusion/src/hybrid_search.rs
index 67b2d032..1912c5f5 100644
--- a/crates/integrations/datafusion/src/hybrid_search.rs
+++ b/crates/integrations/datafusion/src/hybrid_search.rs
@@ -535,7 +535,7 @@ fn extract_named_struct_fields<'a>(
     }
 
     let mut fields = Vec::with_capacity(function.args.len() / 2);
-    for pair in function.args.chunks_exact(2) {
+    for pair in function.args.as_chunks::<2>().0 {
         let key = extract_string_literal(FUNCTION_NAME, &pair[0], "route field 
name")?;
         fields.push((key, &pair[1]));
     }
@@ -862,7 +862,9 @@ fn extract_options(expr: &Expr) -> DFResult<HashMap<String, 
String>> {
 
     function
         .args
-        .chunks_exact(2)
+        .as_chunks::<2>()
+        .0
+        .iter()
         .map(|pair| {
             Ok((
                 extract_string_literal(FUNCTION_NAME, &pair[0], "options 
key")?,
diff --git a/crates/paimon/src/spec/murmur_hash.rs 
b/crates/paimon/src/spec/murmur_hash.rs
index bf7b1a25..3029e67b 100644
--- a/crates/paimon/src/spec/murmur_hash.rs
+++ b/crates/paimon/src/spec/murmur_hash.rs
@@ -60,8 +60,8 @@ pub fn hash_by_words(data: &[u8]) -> i32 {
         data.len()
     );
     let mut h1 = DEFAULT_SEED;
-    for chunk in data.chunks_exact(4) {
-        let word = u32::from_le_bytes([chunk[0], chunk[1], chunk[2], 
chunk[3]]);
+    for chunk in data.as_chunks::<4>().0 {
+        let word = u32::from_le_bytes(*chunk);
         let k1 = mix_k1(word);
         h1 = mix_h1(h1, k1);
     }
diff --git a/crates/paimon/src/table/vector_search_builder.rs 
b/crates/paimon/src/table/vector_search_builder.rs
index 497ccd98..9867c582 100644
--- a/crates/paimon/src/table/vector_search_builder.rs
+++ b/crates/paimon/src/table/vector_search_builder.rs
@@ -3786,8 +3786,8 @@ mod tests {
                 metric,
             )
             .unwrap();
-            for (row_index, stored_vector) in 
stored.chunks_exact(2).enumerate() {
-                for (query_index, query) in 
queries.chunks_exact(2).enumerate() {
+            for (row_index, stored_vector) in 
stored.as_chunks::<2>().0.iter().enumerate() {
+                for (query_index, query) in 
queries.as_chunks::<2>().0.iter().enumerate() {
                     let expected = compute_raw_vector_score(query, 
stored_vector, metric);
                     let actual = matrix_scores[query_index * 3 + row_index];
                     assert!(

Reply via email to