Skip to content

Commit 4bc4a5b

Browse files
lolbinarycatfmease
andcommitted
Apply suggestions from code review (formatting and comments)
Co-authored-by: León Orell Valerian Liehr <me@fmease.dev>
1 parent 43d4c74 commit 4bc4a5b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/librustdoc/passes/collect_intra_doc_links.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -944,9 +944,10 @@ fn preprocess_link(
944944
// certain link kinds cannot have their path be urls,
945945
// so they should not be ignored, no matter how much they look like urls.
946946
// e.g. [https://example.com/] is not a link to example.com.
947-
let can_be_url = ori_link.kind != LinkType::ShortcutUnknown
948-
&& ori_link.kind != LinkType::CollapsedUnknown
949-
&& ori_link.kind != LinkType::ReferenceUnknown;
947+
let can_be_url = !matches!(
948+
ori_link.kind,
949+
LinkType::ShortcutUnknown | LinkType::CollapsedUnknown | LinkType::ReferenceUnknown
950+
);
950951

951952
// [] is mostly likely not supposed to be a link
952953
if ori_link.link.is_empty() {
@@ -996,7 +997,7 @@ fn preprocess_link(
996997
}
997998
};
998999

999-
// If there's no backticks, be lenient revert to old behavior.
1000+
// If there's no backticks, be lenient and revert to the old behavior.
10001001
// This is to prevent churn by linting on stuff that isn't meant to be a link.
10011002
// only shortcut links have simple enough syntax that they
10021003
// are likely to be written accidentlly, collapsed and reference links

0 commit comments

Comments
 (0)