File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,8 @@ macro_rules! build_table_column_slice_getter {
118118 ( $( #[ $attr: meta] ) * => $column: ident, $name: ident, $cast: ty) => {
119119 $( #[ $attr] ) *
120120 pub fn $name( & self ) -> & [ $cast] {
121- $crate:: sys:: generate_slice( self . as_ref( ) . $column, self . num_rows( ) )
121+ // SAFETY: all array lengths are the number of rows in the table
122+ unsafe { $crate:: sys:: generate_slice( self . as_ref( ) . $column, self . num_rows( ) ) }
122123 }
123124 } ;
124125}
@@ -127,7 +128,8 @@ macro_rules! build_table_column_slice_mut_getter {
127128 ( $( #[ $attr: meta] ) * => $column: ident, $name: ident, $cast: ty) => {
128129 $( #[ $attr] ) *
129130 pub fn $name( & mut self ) -> & mut [ $cast] {
130- $crate:: sys:: generate_slice_mut( self . as_ref( ) . $column, self . num_rows( ) )
131+ // SAFETY: all array lengths are the number of rows in the table
132+ unsafe { $crate:: sys:: generate_slice_mut( self . as_ref( ) . $column, self . num_rows( ) ) }
131133 }
132134 } ;
133135}
You can’t perform that action at this time.
0 commit comments