Skip to content

Commit 51157fc

Browse files
author
Noah Wahl
committed
feat(tree): time capsule message
1 parent f7fe78c commit 51157fc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/tree.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ pub struct Tree {
2727
impl Tree {
2828
#[time("debug", "Tree::{}")]
2929
pub fn new(lineages: Vec<String>, sequences: Vec<Vec<u8>>) -> Result<Self> {
30+
assert!(u32::try_from(lineages.len()).is_ok(),
31+
"Hello Future!! Seems like we are finally having Billions of sequences in our databases. Neat!\n
32+
This unfortunately breaks some stuff, but don't despair!\n
33+
Just change u32 to usize for the data structures storing sequence indices in the Tree-struct and fix any casting errors.\n
34+
P.S. If you bring this to my attention I will put you on a leaderboard or something!");
3035
let mut root = Node::new(String::from("root"), 0, NodeType::Inner);
3136
let mut sequence_map: HashMap<Vec<u8>, Vec<u32>> =
3237
sequences.iter().map(|s| (s.clone(), Vec::new())).collect();

0 commit comments

Comments
 (0)