@@ -436,8 +436,7 @@ fn find<Tbl: Table, Col: Index + Column<Table = Tbl>>(col_val: &Col::ColType) ->
436436 let index_id = Col :: index_id ( ) ;
437437 let point = IterBuf :: serialize ( col_val) . unwrap ( ) ;
438438
439- let iter = sys:: datastore_index_scan_point_bsatn ( index_id, & point)
440- . unwrap_or_else ( |e| panic ! ( "unique: unexpected error from `datastore_index_scan_point_bsatn`: {e}" ) ) ;
439+ let iter = datastore_index_scan_point_bsatn ( index_id, & point) ;
441440 let mut iter = TableIter :: new_with_buf ( iter, point) ;
442441
443442 // We will always find either 0 or 1 rows here due to the unique constraint.
@@ -449,6 +448,13 @@ fn find<Tbl: Table, Col: Index + Column<Table = Tbl>>(col_val: &Col::ColType) ->
449448 row
450449}
451450
451+ /// See `sys::datastore_index_scan_point_bsatn`.
452+ /// Panics when the aforementioned errors.
453+ fn datastore_index_scan_point_bsatn ( index_id : IndexId , point : & [ u8 ] ) -> sys:: RowIter {
454+ sys:: datastore_index_scan_point_bsatn ( index_id, point)
455+ . unwrap_or_else ( |e| panic ! ( "unexpected error from `datastore_index_scan_point_bsatn`: {e}" ) )
456+ }
457+
452458/// A read-only handle to a unique (single-column) index.
453459///
454460/// This is the read-only version of [`UniqueColumn`].
@@ -654,10 +660,7 @@ where
654660 Idx : IndexIsPointed ,
655661{
656662 let index_id = Idx :: index_id ( ) ;
657- let iter = point. with_point_arg ( |point| {
658- sys:: datastore_index_scan_point_bsatn ( index_id, point)
659- . unwrap_or_else ( |e| panic ! ( "unexpected error from `datastore_index_scan_point_bsatn`: {e}" ) )
660- } ) ;
663+ let iter = point. with_point_arg ( |point| datastore_index_scan_point_bsatn ( index_id, point) ) ;
661664 TableIter :: new ( iter)
662665}
663666
@@ -980,10 +983,7 @@ where
980983 let index_id = Idx :: index_id ( ) ;
981984
982985 let iter = if const { is_point_scan :: < Idx , B , _ , _ > ( ) } {
983- b. with_point_arg ( |point| {
984- sys:: datastore_index_scan_point_bsatn ( index_id, point)
985- . unwrap_or_else ( |e| panic ! ( "unexpected error from `datastore_index_scan_point_bsatn`: {e}" ) )
986- } )
986+ b. with_point_arg ( |point| datastore_index_scan_point_bsatn ( index_id, point) )
987987 } else {
988988 let args = b. get_range_args ( ) ;
989989 let ( prefix, prefix_elems, rstart, rend) = args. args_for_syscall ( ) ;
0 commit comments