diff options
| author | bors <bors@rust-lang.org> | 2021-08-01 09:15:15 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-08-01 09:15:15 +0000 |
| commit | aadd6189ad5c81f50d942c584ed1c1b49892765f (patch) | |
| tree | 0dbe207064f82de546fcbe6f63bb12b40f7c322e /src | |
| parent | f381e77d3590bc36f09b0d48cffb504f92febf5e (diff) | |
| parent | 3fd8cbb404666e0b979efa9a886674b4a9f58868 (diff) | |
Auto merge of #87449 - matthiaskrgr:clippyy_v2, r=nagisa
more clippy::complexity fixes (also a couple of clippy::perf fixes)
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/html/format.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index cd74006530b..0291236abdf 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -488,7 +488,7 @@ crate fn href(did: DefId, cx: &Context<'_>) -> Result<(String, ItemType, Vec<Str let cache = &cx.cache(); let relative_to = &cx.current; fn to_module_fqp(shortty: ItemType, fqp: &[String]) -> &[String] { - if shortty == ItemType::Module { &fqp[..] } else { &fqp[..fqp.len() - 1] } + if shortty == ItemType::Module { fqp } else { &fqp[..fqp.len() - 1] } } if !did.is_local() && !cache.access_levels.is_public(did) && !cache.document_private { @@ -509,7 +509,7 @@ crate fn href(did: DefId, cx: &Context<'_>) -> Result<(String, ItemType, Vec<Str match cache.extern_locations[&did.krate] { ExternalLocation::Remote(ref s) => { let s = s.trim_end_matches('/'); - let mut s = vec![&s[..]]; + let mut s = vec![s]; s.extend(module_fqp[..].iter().map(String::as_str)); s } |
