We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Very sure this is from my lack of understanding of a radix tree...but can someone tell me why the second test fails pls. Thanks in advance.
#[test] fn test_example() { let mut t = Trie::new(); t.insert("/1", "1"); t.insert("/1/1.1", "1.1"); t.insert("/1/1.2", "1.2"); t.insert("/1/1.3", "1.3"); // t.insert("/2", "2"); let v: Vec<&str> = t .get_raw_ancestor("") .children() .map(|s| *s.value().unwrap()) .collect(); let mut iter = v.iter(); assert!(*iter.next().unwrap() == "1"); assert!(iter.next().is_none()); } #[test] fn test_example_fails() { let mut t = Trie::new(); t.insert("/1", "1"); t.insert("/1/1.1", "1.1"); t.insert("/1/1.2", "1.2"); t.insert("/1/1.3", "1.3"); t.insert("/2", "2"); // <- uncommented let v: Vec<&str> = t .get_raw_ancestor("") .children() .map(|s| *s.value().unwrap()) //<-panics .collect(); let mut iter = v.iter(); assert!(*iter.next().unwrap() == "1"); assert!(*iter.next().unwrap() == "2"); assert!(iter.next().is_none()); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Very sure this is from my lack of understanding of a radix tree...but can someone tell me why the second test fails pls. Thanks in advance.
The text was updated successfully, but these errors were encountered: