Skip to content

Commit 41831ba

Browse files
committed
more
1 parent 302bf05 commit 41831ba

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/site_table.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -202,14 +202,7 @@ impl SiteTable {
202202
/// * `Some(position)` if `row` is valid.
203203
/// * `None` otherwise.
204204
pub fn position<S: Into<SiteId> + Copy>(&self, row: S) -> Option<Position> {
205-
assert!(self.num_rows() == 0 || !self.as_ref().position.is_null());
206-
unsafe {
207-
sys::tsk_column_access::<Position, _, _, _>(
208-
row.into(),
209-
self.as_ref().position,
210-
self.num_rows(),
211-
)
212-
}
205+
self.table_.position(row.into())
213206
}
214207

215208
/// Get the ``ancestral_state`` value from row ``row`` of the table.

src/sys/site_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::newtypes::Position;
4+
use super::newtypes::SiteId;
5+
36
use super::bindings::tsk_id_t;
47
use super::bindings::tsk_site_table_add_row;
58
use super::bindings::tsk_site_table_clear;
@@ -66,6 +69,10 @@ impl SiteTable {
6669
))
6770
}
6871
}
72+
73+
pub fn position(&self, row: SiteId) -> Option<Position> {
74+
safe_tsk_column_access!(self, row, Position, position)
75+
}
6976
}
7077

7178
impl Default for SiteTable {

0 commit comments

Comments
 (0)