Skip to content

Commit a8e7d47

Browse files
committed
cool
1 parent 9ba1cb3 commit a8e7d47

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/table_collection.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -882,11 +882,11 @@ impl TableCollection {
882882
/// Return a [`crate::TreeSequence`] based on the tables.
883883
/// This function will raise errors if tables are not sorted,
884884
/// not indexed, or invalid in any way.
885-
pub fn tree_sequence(
885+
pub fn tree_sequence<F: Into<TreeSequenceFlags>>(
886886
self,
887-
flags: TreeSequenceFlags,
887+
flags: F,
888888
) -> Result<crate::TreeSequence, TskitError> {
889-
crate::TreeSequence::new(self, flags)
889+
crate::TreeSequence::new(self, flags.into())
890890
}
891891

892892
/// Simplify tables in place.
@@ -979,9 +979,9 @@ impl TableCollection {
979979
/// tables.add_edge(0., 10.0, tskit::NodeId::NULL, 0);
980980
/// tables.check_integrity(tskit::TableIntegrityCheckFlags::default()).unwrap();
981981
/// ```
982-
pub fn check_integrity(&self, flags: TableIntegrityCheckFlags) -> TskReturnValue {
982+
pub fn check_integrity<F: Into<TableIntegrityCheckFlags>>(&self, flags: F) -> TskReturnValue {
983983
let rv = unsafe {
984-
ll_bindings::tsk_table_collection_check_integrity(self.as_ptr(), flags.bits())
984+
ll_bindings::tsk_table_collection_check_integrity(self.as_ptr(), flags.into().bits())
985985
};
986986
handle_tsk_return_value!(rv)
987987
}

src/table_views.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ mod table_views_tests {
266266
tables.add_node(0, 1.0, -1, -1).unwrap(); // parent
267267
tables.add_edge(0., 100., 1, 0).unwrap();
268268
let ts = tables
269-
.tree_sequence(crate::TreeSequenceFlags::BUILD_INDEXES.into())
269+
.tree_sequence(crate::TreeSequenceFlags::BUILD_INDEXES)
270270
.unwrap();
271271
assert_eq!(ts.edges().num_rows(), 1);
272272
assert_eq!(ts.nodes().num_rows(), 2);

0 commit comments

Comments
 (0)