Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Antosser committed Aug 5, 2024
1 parent 9f1cbef commit 783634b
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,12 @@ fn get_urls_from_document(doc: &str) -> Result<Vec<String>, String> {
}
};

let value = match {
match tag.attributes().get("href") {
let value = match match tag.attributes().get("href") {
Some(x) => x,
None => match tag.attributes().get("src") {
Some(x) => x,
None => match tag.attributes().get("src") {
Some(x) => x,
None => continue,
},
}
None => continue,
},
} {
Some(x) => x,
None => continue,
Expand Down Expand Up @@ -279,8 +277,8 @@ fn crawl(
let mut urls_locked = urls.lock().unwrap();

for mut i in found {
i = Url::parse(i.to_string().split('?').next().unwrap_or(i.as_ref())).unwrap(); // Unreachable .unwrap()
i = Url::parse(i.to_string().split('#').next().unwrap_or(i.as_ref())).unwrap(); // Unreachable .unwrap()
i = Url::parse(i.as_ref().split('?').next().unwrap_or(i.as_ref())).unwrap(); // Unreachable .unwrap()
i = Url::parse(i.as_ref().split('#').next().unwrap_or(i.as_ref())).unwrap(); // Unreachable .unwrap()

if !urls_locked.iter().any(|x| x.as_str() == i.as_str())
&& !args.exclude.iter().any(|j| i.path().starts_with(j))
Expand Down

0 comments on commit 783634b

Please sign in to comment.