Skip to content

Commit 6afae85

Browse files
lolbinarycatfmease
andauthored
Apply suggestions from code review (formatting and comments)
Co-authored-by: León Orell Valerian Liehr <me@fmease.dev>
1 parent 32a73bf commit 6afae85

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
@@ -934,9 +934,10 @@ fn preprocess_link(
934934
// certain link kinds cannot have their path be urls,
935935
// so they should not be ignored, no matter how much they look like urls.
936936
// e.g. [https://example.com/] is not a link to example.com.
937-
let can_be_url = ori_link.kind != LinkType::ShortcutUnknown
938-
&& ori_link.kind != LinkType::CollapsedUnknown
939-
&& ori_link.kind != LinkType::ReferenceUnknown;
937+
let can_be_url = !matches!(
938+
ori_link.kind,
939+
LinkType::ShortcutUnknown | LinkType::CollapsedUnknown | LinkType::ReferenceUnknown
940+
);
940941

941942
// [] is mostly likely not supposed to be a link
942943
if ori_link.link.is_empty() {
@@ -986,7 +987,7 @@ fn preprocess_link(
986987
}
987988
};
988989

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

0 commit comments

Comments
 (0)