Skip to content

Commit 302bf05

Browse files
committed
More
1 parent 4634a8a commit 302bf05

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/individual_table.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -209,15 +209,7 @@ impl IndividualTable {
209209
/// * `Some(flags)` if `row` is valid.
210210
/// * `None` otherwise.
211211
pub fn flags<I: Into<IndividualId> + Copy>(&self, row: I) -> Option<IndividualFlags> {
212-
assert!(self.num_rows() == 0 || !self.as_ref().flags.is_null());
213-
// SAFETY: either the column is empty or the point is not NULL
214-
unsafe {
215-
sys::tsk_column_access::<IndividualFlags, _, _, _>(
216-
row.into(),
217-
self.as_ref().flags,
218-
self.num_rows(),
219-
)
220-
}
212+
self.table_.flags(row.into())
221213
}
222214

223215
/// Return the locations for a given row.

src/sys/individual_table.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
use std::ptr::NonNull;
22

3+
use super::flags::IndividualFlags;
4+
use super::newtypes::IndividualId;
5+
36
use super::bindings::tsk_flags_t;
47
use super::bindings::tsk_id_t;
58
use super::bindings::tsk_individual_table_add_row;
@@ -66,6 +69,10 @@ impl IndividualTable {
6669
))
6770
}
6871
}
72+
73+
pub fn flags(&self, row: IndividualId) -> Option<IndividualFlags> {
74+
safe_tsk_column_access!(self, row, IndividualFlags, flags)
75+
}
6976
}
7077

7178
impl Default for IndividualTable {

0 commit comments

Comments
 (0)