Browse Source

Touch up dead link error message (#698)

index-subcmd
Marcus Klaas de Vries Vincent Prouillet 5 years ago
parent
commit
bada9ab93f
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      components/site/src/lib.rs

+ 3
- 3
components/site/src/lib.rs View File

@@ -280,11 +280,11 @@ impl Site {


let errors: Vec<_> = pool.install(|| { let errors: Vec<_> = pool.install(|| {
all_links.par_iter().filter_map(|(path, link)| { all_links.par_iter().filter_map(|(path, link)| {
let res = check_url(link);
let res = check_url(&link);
if res.is_valid() { if res.is_valid() {
None None
} else { } else {
Some((path, res))
Some((path, link, res))
} }
}).collect() }).collect()
}); });
@@ -293,7 +293,7 @@ impl Site {
Ok(()) Ok(())
} else { } else {
let msg = errors.into_iter() let msg = errors.into_iter()
.map(|(path, check_res)| format!("Dead link in {:?}: {:?}", path, check_res))
.map(|(path, link, check_res)| format!("Dead link in {} to {}: {}", path.to_string_lossy(), link, check_res.message()))
.collect::<Vec<_>>() .collect::<Vec<_>>()
.join("\n"); .join("\n");
Err(Error { Err(Error {


Loading…
Cancel
Save