From a75192bcfe2d1a4a639d703b7b3271f857bec7b7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Matthias=20Kr=C3=BCger?= Date: Sat, 17 Jul 2021 09:13:08 +0200 Subject: [PATCH] don't slice slices (clippy::redundant_slicing) --- src/librustdoc/html/format.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index 08499cef33e..fe33018df28 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -488,7 +488,7 @@ fn print<'a, 'tcx: 'a>( 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 @@ fn to_module_fqp(shortty: ItemType, fqp: &[String]) -> &[String] { 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 } -- 2.44.0