Skip to content

Commit d78f19e

Browse files
committed
Use const instead of function
1 parent 0321562 commit d78f19e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/librustdoc/html/render.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ impl<'a> SourceCollector<'a> {
922922
ty: "source",
923923
root_path: &root_path,
924924
description: &desc,
925-
keywords: get_basic_keywords(),
925+
keywords: BASIC_KEYWORDS,
926926
};
927927
try!(layout::render(&mut w, &self.cx.layout,
928928
&page, &(""), &Source(contents)));
@@ -2646,12 +2646,10 @@ fn item_primitive(w: &mut fmt::Formatter, cx: &Context,
26462646
render_assoc_items(w, cx, it, it.def_id, AssocItemRender::All)
26472647
}
26482648

2649-
fn get_basic_keywords() -> &'static str {
2650-
"rust, rustlang, rust-lang"
2651-
}
2649+
const BASIC_KEYWORDS: &'static str = "rust, rustlang, rust-lang";
26522650

26532651
fn make_item_keywords(it: &clean::Item) -> String {
2654-
format!("{}, {}", get_basic_keywords(), it.name.as_ref().unwrap())
2652+
format!("{}, {}", BASIC_KEYWORDS, it.name.as_ref().unwrap())
26552653
}
26562654

26572655
fn get_index_search_type(item: &clean::Item,

0 commit comments

Comments
 (0)