diff options
| author | Kyle Lin <minecraft.kyle.train@gmail.com> | 2023-07-01 01:29:40 +0800 |
|---|---|---|
| committer | Kyle Lin <minecraft.kyle.train@gmail.com> | 2023-08-18 15:19:19 +0800 |
| commit | 78c85f439f04f2aa484a9f1be3133d74bda87c7d (patch) | |
| tree | 15d6b2ff17bd81918e873b364e6756530bc8d755 /src | |
| parent | fe17ae3af6e1ff42b81a5309dc88b36dacfc8577 (diff) | |
| download | rust-78c85f439f04f2aa484a9f1be3133d74bda87c7d.tar.gz rust-78c85f439f04f2aa484a9f1be3133d74bda87c7d.zip | |
fomar files
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/passes/lint/redundant_explicit_links.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/librustdoc/passes/lint/redundant_explicit_links.rs b/src/librustdoc/passes/lint/redundant_explicit_links.rs index da8a73be60b..a41e278fd81 100644 --- a/src/librustdoc/passes/lint/redundant_explicit_links.rs +++ b/src/librustdoc/passes/lint/redundant_explicit_links.rs @@ -34,7 +34,7 @@ pub(crate) fn visit_item(cx: &DocContext<'_>, item: &Item) { if item.link_names(&cx.cache).is_empty() { // If there's no link names in this item, - // then we skip resolution querying to + // then we skip resolution querying to // avoid from panicking. return; } @@ -80,7 +80,8 @@ fn check_redundant_explicit_link<'md>( if (explicit_len >= display_len && &explicit_link[(explicit_len - display_len)..] == display_link) || (display_len >= explicit_len - && &display_link[(display_len - explicit_len)..] == explicit_link) { + && &display_link[(display_len - explicit_len)..] == explicit_link) + { match link_type { LinkType::Inline | LinkType::ReferenceUnknown => { check_inline_or_reference_unknown_redundancy( @@ -92,7 +93,11 @@ fn check_redundant_explicit_link<'md>( link_range, dest.to_string(), link_data, - if link_type == LinkType::Inline { (b'(', b')') } else { (b'[', b']') }, + if link_type == LinkType::Inline { + (b'(', b')') + } else { + (b'[', b']') + }, ); } LinkType::Reference => { @@ -110,7 +115,7 @@ fn check_redundant_explicit_link<'md>( _ => {} } } - }, + } _ => {} } } |
