From d78f19ebbdeb597cd15293e5f90dc9c106949048 Mon Sep 17 00:00:00 2001 From: mitaa Date: Sun, 28 Feb 2016 14:01:43 +0100 Subject: [PATCH] Use const instead of function --- src/librustdoc/html/render.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 88f21b67a5ac6..d424c7383be3f 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -922,7 +922,7 @@ impl<'a> SourceCollector<'a> { ty: "source", root_path: &root_path, description: &desc, - keywords: get_basic_keywords(), + keywords: BASIC_KEYWORDS, }; try!(layout::render(&mut w, &self.cx.layout, &page, &(""), &Source(contents))); @@ -2646,12 +2646,10 @@ fn item_primitive(w: &mut fmt::Formatter, cx: &Context, render_assoc_items(w, cx, it, it.def_id, AssocItemRender::All) } -fn get_basic_keywords() -> &'static str { - "rust, rustlang, rust-lang" -} +const BASIC_KEYWORDS: &'static str = "rust, rustlang, rust-lang"; fn make_item_keywords(it: &clean::Item) -> String { - format!("{}, {}", get_basic_keywords(), it.name.as_ref().unwrap()) + format!("{}, {}", BASIC_KEYWORDS, it.name.as_ref().unwrap()) } fn get_index_search_type(item: &clean::Item,