File tree 2 files changed +3
-15
lines changed
2 files changed +3
-15
lines changed Original file line number Diff line number Diff line change @@ -89,14 +89,7 @@ impl TableCollection {
89
89
} )
90
90
}
91
91
92
- /// # Safety
93
- ///
94
- /// It is possible that the mbox's inner pointer has not be run through
95
- /// tsk_table_collection_init, meaning that it is in an uninitialized state.
96
- /// Or, it may be initialized and about to be used in a part of the C API
97
- /// requiring an uninitialized table collection.
98
- /// Consult the C API docs before using!
99
- pub ( crate ) unsafe fn new_from_ll ( lltables : LLTableCollection ) -> Result < Self , TskitError > {
92
+ pub ( crate ) fn new_from_ll ( lltables : LLTableCollection ) -> Result < Self , TskitError > {
100
93
let mut inner = lltables;
101
94
let views = crate :: table_views:: TableViews :: new_from_ll_table_collection ( & mut inner) ?;
102
95
Ok ( Self {
@@ -748,10 +741,7 @@ impl TableCollection {
748
741
/// Return a "deep" copy of the tables.
749
742
pub fn deepcopy ( & self ) -> Result < TableCollection , TskitError > {
750
743
let ( rv, inner) = self . inner . copy ( ) ;
751
-
752
- // SAFETY: we just initialized it.
753
- // The C API doesn't free NULL pointers.
754
- let tables = unsafe { TableCollection :: new_from_ll ( inner) } ?;
744
+ let tables = TableCollection :: new_from_ll ( inner) ?;
755
745
handle_tsk_return_value ! ( rv, tables)
756
746
}
757
747
Original file line number Diff line number Diff line change @@ -179,9 +179,7 @@ impl TreeSequence {
179
179
ll_bindings:: tsk_table_collection_copy ( ( * self . as_ptr ( ) ) . tables , inner. as_mut_ptr ( ) , 0 )
180
180
} ;
181
181
182
- // SAFETY: we just initialized it.
183
- // The C API doesn't free NULL pointers.
184
- handle_tsk_return_value ! ( rv, unsafe { TableCollection :: new_from_ll( inner) ? } )
182
+ handle_tsk_return_value ! ( rv, TableCollection :: new_from_ll( inner) ?)
185
183
}
186
184
187
185
/// Create an iterator over trees.
You can’t perform that action at this time.
0 commit comments