Skip to content

Commit dd264db

Browse files
committed
use IndividualId for add_node_*
1 parent ddb978e commit dd264db

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/table_collection.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -283,23 +283,23 @@ impl TableCollection {
283283
}
284284

285285
/// Add a row to the node table
286-
pub fn add_node(
286+
pub fn add_node<I: Into<IndividualId>>(
287287
&mut self,
288288
flags: ll_bindings::tsk_flags_t,
289289
time: f64,
290290
population: tsk_id_t,
291-
individual: tsk_id_t,
291+
individual: I,
292292
) -> Result<NodeId, TskitError> {
293293
self.add_node_with_metadata(flags, time, population, individual, None)
294294
}
295295

296296
/// Add a row with metadata to the node table
297-
pub fn add_node_with_metadata(
297+
pub fn add_node_with_metadata<I: Into<IndividualId>>(
298298
&mut self,
299299
flags: ll_bindings::tsk_flags_t,
300300
time: f64,
301301
population: tsk_id_t,
302-
individual: tsk_id_t,
302+
individual: I,
303303
metadata: Option<&dyn MetadataRoundtrip>,
304304
) -> Result<NodeId, TskitError> {
305305
let md = EncodedMetadata::new(metadata)?;
@@ -309,7 +309,7 @@ impl TableCollection {
309309
flags,
310310
time,
311311
population,
312-
individual,
312+
individual.into().0,
313313
md.as_ptr(),
314314
md.len(),
315315
)

0 commit comments

Comments
 (0)