Touch up dead link error message (#698)

This commit is contained in:
Marcus Klaas de Vries 2019-05-27 16:24:42 +02:00 committed by Vincent Prouillet
parent ec61a57841
commit bada9ab93f

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 {