Skip to content

Commit e0336e4

Browse files
committed
more
1 parent 3b7e59c commit e0336e4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/_macros.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)