Skip to content

Commit 3fc2864

Browse files
ta-nishqTanishq
authored andcommitted
Fix link check report inconsistency (getzola#2472)
* Fix link check report inconsistency * Fix formatting issue --------- Co-authored-by: Tanishq <[email protected]>
1 parent ec1f96b commit 3fc2864

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

components/site/src/link_checking.rs

+8-6
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,15 @@ pub fn check_external_links(site: &Site) -> Vec<String> {
178178
}
179179
}
180180

181+
// Get unique links count from Vec by creating a temporary HashSet.
182+
let unique_links_count = HashSet::<&str>::from_iter(
183+
checked_links.iter().map(|link_def| link_def.external_link.as_str()),
184+
)
185+
.len();
186+
181187
println!(
182188
"Checking {} external link(s). Skipping {} external link(s).{}",
183-
// Get unique links count from Vec by creating a temporary HashSet.
184-
HashSet::<&str>::from_iter(
185-
checked_links.iter().map(|link_def| link_def.external_link.as_str())
186-
)
187-
.len(),
189+
unique_links_count,
188190
skipped_link_count,
189191
if invalid_url_links == 0 {
190192
"".to_string()
@@ -272,7 +274,7 @@ pub fn check_external_links(site: &Site) -> Vec<String> {
272274

273275
println!(
274276
"> Checked {} external link(s): {} error(s) found.",
275-
checked_links.len(),
277+
unique_links_count,
276278
errors.len()
277279
);
278280

0 commit comments

Comments
 (0)