Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/tools/linkchecker/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,12 @@ fn check(cache: &mut Cache,
// exist! If it doesn't then we register and print an error.
if path.exists() {
if path.is_dir() {
// Links to directories show as directory listings when viewing
// the docs offline so it's best to avoid them.
*errors = true;
let pretty_path = path.strip_prefix(root).unwrap_or(&path);
println!("{}:{}: directory link - {}", pretty_file.display(),
i + 1, pretty_path.display());
return;
}
let res = load_file(cache, root, path.clone(), FromRedirect(false));
Expand Down