Skip to content

Commit 2cca075

Browse files
committed
fix tests
1 parent 6bdf3e8 commit 2cca075

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

examples/forward_simulation.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,9 @@ fn simplify(
368368
Ok(x) => match x {
369369
Some(idmap) => {
370370
for a in alive.iter_mut() {
371-
a.node0 = idmap[usize::from(a.node0)];
371+
a.node0 = idmap[usize::try_from(a.node0).unwrap()];
372372
assert!(a.node0 != tskit::NodeId::NULL);
373-
a.node1 = idmap[usize::from(a.node1)];
373+
a.node1 = idmap[usize::try_from(a.node1).unwrap()];
374374
assert!(a.node1 != tskit::NodeId::NULL);
375375
}
376376
}

src/test_simplification.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ mod tests {
3737
assert!(idmap_option.is_some());
3838
let idmap = idmap_option.unwrap();
3939
for &i in samples {
40-
assert_ne!(idmap[usize::from(i)], NodeId::NULL);
40+
assert_ne!(idmap[usize::try_from(i).unwrap()], NodeId::NULL);
4141
}
4242
}
4343
}

0 commit comments

Comments
 (0)