From 981d0322262c4bce773fdadc7d3fb4d6787ed5c2 Mon Sep 17 00:00:00 2001 From: angelip2303 Date: Tue, 28 Nov 2023 10:25:49 +0000 Subject: [PATCH] fixed --- src/engine/chunk.rs | 2 +- src/storage/layout.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/engine/chunk.rs b/src/engine/chunk.rs index 2ad1713..88029ab 100644 --- a/src/engine/chunk.rs +++ b/src/engine/chunk.rs @@ -32,6 +32,6 @@ impl EngineStrategy> for Array { let end = vec![self.shape()[0], index as u64]; let shape = &ArraySubset::new_with_start_end_inc(start, end)?; let ans = self.retrieve_array_subset_elements(shape)?; - Ok(ans) + Ok(ans.to_vec()) } } diff --git a/src/storage/layout.rs b/src/storage/layout.rs index 0a11ed1..66a326f 100644 --- a/src/storage/layout.rs +++ b/src/storage/layout.rs @@ -45,7 +45,7 @@ pub trait LayoutOps { iter.for_each(|chunk| { arr.store_chunk_elements( &[count.load(Ordering::Relaxed), 0], - self.chunk_elements(chunk, objects_size).as_slice(), + self.chunk_elements(chunk, objects_size), ) .unwrap(); count.fetch_add(1, Ordering::Relaxed); @@ -58,7 +58,7 @@ pub trait LayoutOps { vec![remainder.len() as u64, objects_per_chunk(&arr)], ) .unwrap(), // TODO: remove unwrap - self.chunk_elements(remainder, objects_size).as_slice(), + self.chunk_elements(remainder, objects_size), ) .unwrap(); }