@@ -31,7 +31,6 @@ use vortex_dtype::DType;
3131use vortex_dtype:: NativePType ;
3232use vortex_dtype:: match_each_integer_ptype;
3333use vortex_error:: VortexExpect ;
34- use vortex_error:: VortexUnwrap ;
3534use vortex_error:: vortex_panic;
3635use vortex_utils:: aliases:: hash_map:: HashMap ;
3736
@@ -229,15 +228,15 @@ impl RDEncoder {
229228 // SAFETY: by construction, all values in left_parts can be packed to left_bit_width.
230229 let packed_left = unsafe {
231230 bitpack_encode_unchecked ( primitive_left, left_bit_width as _ )
232- . vortex_unwrap ( )
231+ . vortex_expect ( "bitpack_encode_unchecked should succeed for left parts" )
233232 . into_array ( )
234233 } ;
235234
236235 let primitive_right = PrimitiveArray :: new ( right_parts, Validity :: NonNullable ) ;
237236 // SAFETY: by construction, all values in right_parts are right_bit_width + leading zeros.
238237 let packed_right = unsafe {
239238 bitpack_encode_unchecked ( primitive_right, self . right_bit_width as _ )
240- . vortex_unwrap ( )
239+ . vortex_expect ( "bitpack_encode_unchecked should succeed for right parts" )
241240 . into_array ( )
242241 } ;
243242
@@ -252,7 +251,9 @@ impl RDEncoder {
252251 // SAFETY: We calculate bw such that it is wide enough to hold the largest position index.
253252 let packed_pos = unsafe {
254253 bitpack_encode_unchecked ( exc_pos_array, bw)
255- . vortex_unwrap ( )
254+ . vortex_expect (
255+ "bitpack_encode_unchecked should succeed for exception positions" ,
256+ )
256257 . into_array ( )
257258 } ;
258259
0 commit comments