mirror of
https://gitlab.com/news-flash/article_scraper.git
synced 2025-07-07 16:15:32 +02:00
clippy fix
This commit is contained in:
parent
b5d8f43ef8
commit
29daf06a1b
1 changed files with 10 additions and 14 deletions
24
src/util.rs
24
src/util.rs
|
@ -288,22 +288,18 @@ impl Util {
|
||||||
// And finally, move up the parent chain *and* find a sibling
|
// And finally, move up the parent chain *and* find a sibling
|
||||||
// (because this is depth-first traversal, we will have already
|
// (because this is depth-first traversal, we will have already
|
||||||
// seen the parent nodes themselves).
|
// seen the parent nodes themselves).
|
||||||
loop {
|
while let Some(parent) = node.get_parent() {
|
||||||
if let Some(parent) = node.get_parent() {
|
let parent_name = parent.get_name().to_uppercase();
|
||||||
let parent_name = parent.get_name().to_uppercase();
|
if parent_name == "HTML" {
|
||||||
if parent_name == "HTML" {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
let next_sibling = parent.get_next_sibling();
|
|
||||||
if next_sibling.is_some() {
|
|
||||||
return next_sibling;
|
|
||||||
} else {
|
|
||||||
node = parent;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let next_sibling = parent.get_next_sibling();
|
||||||
|
if next_sibling.is_some() {
|
||||||
|
return next_sibling;
|
||||||
|
} else {
|
||||||
|
node = parent;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
None
|
None
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue