Skip to content

Commit 78c85f4

Browse files
committed
fomar files
1 parent fe17ae3 commit 78c85f4

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

compiler/rustc_resolve/src/rustdoc.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,14 @@ fn parse_links<'md>(doc: &'md str) -> Vec<Box<str>> {
410410
while let Some(event) = event_iter.next() {
411411
match event {
412412
Event::Start(Tag::Link(link_type, dest, _)) if may_be_doc_link(link_type) => {
413-
if matches!(link_type, LinkType::Inline | LinkType::ReferenceUnknown | LinkType::Reference) {
413+
if matches!(
414+
link_type,
415+
LinkType::Inline
416+
| LinkType::ReferenceUnknown
417+
| LinkType::Reference
418+
| LinkType::Shortcut
419+
| LinkType::ShortcutUnknown
420+
) {
414421
if let Some(display_text) = collect_link_data(&mut event_iter) {
415422
links.push(display_text);
416423
}

src/librustdoc/passes/lint/redundant_explicit_links.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub(crate) fn visit_item(cx: &DocContext<'_>, item: &Item) {
3434

3535
if item.link_names(&cx.cache).is_empty() {
3636
// If there's no link names in this item,
37-
// then we skip resolution querying to
37+
// then we skip resolution querying to
3838
// avoid from panicking.
3939
return;
4040
}
@@ -80,7 +80,8 @@ fn check_redundant_explicit_link<'md>(
8080
if (explicit_len >= display_len
8181
&& &explicit_link[(explicit_len - display_len)..] == display_link)
8282
|| (display_len >= explicit_len
83-
&& &display_link[(display_len - explicit_len)..] == explicit_link) {
83+
&& &display_link[(display_len - explicit_len)..] == explicit_link)
84+
{
8485
match link_type {
8586
LinkType::Inline | LinkType::ReferenceUnknown => {
8687
check_inline_or_reference_unknown_redundancy(
@@ -92,7 +93,11 @@ fn check_redundant_explicit_link<'md>(
9293
link_range,
9394
dest.to_string(),
9495
link_data,
95-
if link_type == LinkType::Inline { (b'(', b')') } else { (b'[', b']') },
96+
if link_type == LinkType::Inline {
97+
(b'(', b')')
98+
} else {
99+
(b'[', b']')
100+
},
96101
);
97102
}
98103
LinkType::Reference => {
@@ -110,7 +115,7 @@ fn check_redundant_explicit_link<'md>(
110115
_ => {}
111116
}
112117
}
113-
},
118+
}
114119
_ => {}
115120
}
116121
}

0 commit comments

Comments
 (0)