Skip to content

Commit

Permalink
safety
Browse files Browse the repository at this point in the history
  • Loading branch information
molpopgen committed Jul 21, 2022
1 parent cfd22ac commit c1dc8ff
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/table_collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1067,6 +1067,8 @@ impl TableCollection {
/// # assert_eq!(migrations.num_rows(), 0);
/// ```
pub fn set_migrations(&mut self, migrations: &crate::OwnedMigrationTable) -> TskReturnValue {
// SAFETY: neither self nor edges are possible
// to create with null pointers.
let rv = unsafe {
ll_bindings::tsk_migration_table_set_columns(
&mut (*self.inner).migrations,
Expand Down Expand Up @@ -1103,6 +1105,8 @@ impl TableCollection {
/// # assert_eq!(populations.num_rows(), 0);
/// ```
pub fn set_populations(&mut self, populations: &crate::OwnedPopulationTable) -> TskReturnValue {
// SAFETY: neither self nor edges are possible
// to create with null pointers.
let rv = unsafe {
ll_bindings::tsk_population_table_set_columns(
&mut (*self.inner).populations,
Expand Down Expand Up @@ -1140,6 +1144,8 @@ impl TableCollection {
&mut self,
provenances: &crate::provenance::OwnedProvenanceTable,
) -> TskReturnValue {
// SAFETY: neither self nor edges are possible
// to create with null pointers.
let rv = unsafe {
ll_bindings::tsk_provenance_table_set_columns(
&mut (*self.inner).provenances,
Expand Down

0 comments on commit c1dc8ff

Please sign in to comment.