From bf7d7ae7fa2fca33dbe0becebbc75d198321c0a7 Mon Sep 17 00:00:00 2001 From: bluss Date: Wed, 21 Dec 2016 21:27:31 -0800 Subject: [PATCH] use &str instead of String --- src/librustdoc/clean/mod.rs | 4 ++-- src/librustdoc/html/render.rs | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 28ca92f5db6f..5b8b2ecf95d3 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -2205,8 +2205,8 @@ impl Path { } } - pub fn last_name(&self) -> String { - self.segments.last().unwrap().name.clone() + pub fn last_name(&self) -> &str { + self.segments.last().unwrap().name } } diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 846c0721ccbd..5839c46d75d2 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -2110,23 +2110,22 @@ fn item_trait(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,

Implementors