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:
parent
45b4141049
commit
881c2b90ac
2 changed files with 12 additions and 7 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue