1
0
Fork 0
mirror of https://gitlab.com/news-flash/article_scraper.git synced 2025-07-09 00:45:31 +02:00

fix alternate candidates

This commit is contained in:
Jan Lukas Gernert 2023-03-06 01:36:21 +01:00
parent 45b4141049
commit 881c2b90ac
2 changed files with 12 additions and 7 deletions

View file

@ -465,9 +465,10 @@ impl Util {
})
}
pub fn get_node_ancestors(node: &Node, max_depth: u64) -> Vec<Node> {
pub fn get_node_ancestors(node: &Node, max_depth: Option<u64>) -> Vec<Node> {
let mut ancestors = Vec::new();
let mut node = node.clone();
let max_depth = max_depth.unwrap_or(u64::MAX);
for _ in 0..max_depth {
let parent = node.get_parent();