summaryrefslogtreecommitdiff
path: root/support/pkgcheck/src/linkcheck.rs
diff options
context:
space:
mode:
Diffstat (limited to 'support/pkgcheck/src/linkcheck.rs')
-rw-r--r--support/pkgcheck/src/linkcheck.rs21
1 files changed, 10 insertions, 11 deletions
diff --git a/support/pkgcheck/src/linkcheck.rs b/support/pkgcheck/src/linkcheck.rs
index 60b993e960..f73a05c02b 100644
--- a/support/pkgcheck/src/linkcheck.rs
+++ b/support/pkgcheck/src/linkcheck.rs
@@ -89,7 +89,7 @@ fn check_link(url: &str, fname: &str, urlhash: &Arc<Mutex<UrlHash>>, print_all:
let mut urlhash = urlhash.lock().unwrap();
if !urlhash.contains_key(&url) {
let mut hs = HashSet::default();
- hs.insert(f.clone());
+ hs.insert(f);
let url1 = url.clone();
urlhash.insert(
@@ -178,11 +178,10 @@ fn get_links_inner(s: &str) -> Option<Vec<String>> {
}
// This is a workaround to prevent URLs ending with `
if r.ends_with('`') {
- links.push(String::from(&r[..r.len()-1]));
+ links.push(String::from(&r[..r.len() - 1]));
} else {
links.push(String::from(r));
}
-
}
if !links.is_empty() {
Some(links)
@@ -200,8 +199,8 @@ fn check_link_inner(l: &str, head: bool) -> UrlStatus {
),
);
- let default_policy = reqwest::RedirectPolicy::default();
- let policy = reqwest::RedirectPolicy::custom(move |attempt| {
+ let default_policy = reqwest::redirect::Policy::default();
+ let policy = reqwest::redirect::Policy::custom(move |attempt| {
if attempt.url().host_str() == Some("127.0.0.1") {
attempt.stop()
} else {
@@ -209,18 +208,18 @@ fn check_link_inner(l: &str, head: bool) -> UrlStatus {
}
});
- let cb = reqwest::Client::builder()
+ let cb = reqwest::blocking::Client::builder()
.gzip(true)
.redirect(policy)
.default_headers(headers)
.timeout(Duration::from_secs(7))
.build()
.unwrap();
- // let url: Url =
- // match l.parse() {
- // Ok(url) => url,
- // Err(e) => { println!("Error: {:?}", e); panic!("Scheiss"); }
- // };
+ // let url: Url =
+ // match l.parse() {
+ // Ok(url) => url,
+ // Err(e) => { println!("Error: {:?}", e); panic!("Scheiss"); }
+ // };
let resp = if head {
cb.head(l).send()
} else {