Skip to content

Commit a75192b

Browse files
committed
don't slice slices (clippy::redundant_slicing)
1 parent 1c129f7 commit a75192b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustdoc/html/format.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ crate fn href(did: DefId, cx: &Context<'_>) -> Result<(String, ItemType, Vec<Str
488488
let cache = &cx.cache();
489489
let relative_to = &cx.current;
490490
fn to_module_fqp(shortty: ItemType, fqp: &[String]) -> &[String] {
491-
if shortty == ItemType::Module { &fqp[..] } else { &fqp[..fqp.len() - 1] }
491+
if shortty == ItemType::Module { fqp } else { &fqp[..fqp.len() - 1] }
492492
}
493493

494494
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
509509
match cache.extern_locations[&did.krate] {
510510
ExternalLocation::Remote(ref s) => {
511511
let s = s.trim_end_matches('/');
512-
let mut s = vec![&s[..]];
512+
let mut s = vec![s];
513513
s.extend(module_fqp[..].iter().map(String::as_str));
514514
s
515515
}

0 commit comments

Comments
 (0)