提交 d78f19eb 编写于 作者: M mitaa

Use const instead of function

上级 03215621
......@@ -922,7 +922,7 @@ fn emit_source(&mut self, filename: &str) -> io::Result<()> {
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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册