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(|| {
all_links.par_iter().filter_map(|(path, link)| {
let res = check_url(link);
let res = check_url(&link);
if res.is_valid() {
None
} else {
Some((path, res))
Some((path, link, res))
}
}).collect()
});
@ -293,7 +293,7 @@ impl Site {
Ok(())
} else {
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<_>>()
.join("\n");
Err(Error {