提交 801ee834 编写于 作者: G Guillaume Gomez

Use &str instead of String

上级 72459039
......@@ -2122,13 +2122,13 @@ fn print_sidebar_section(
items: &[clean::Item],
before: &str,
filter: impl Fn(&clean::Item) -> bool,
write: impl Fn(&mut Buffer, String),
write: impl Fn(&mut Buffer, &str),
after: &str,
) {
let mut items = items
.iter()
.filter_map(|m| match m.name {
Some(ref name) if filter(m) => Some(name.to_string()),
Some(ref name) if filter(m) => Some(name.as_str()),
_ => None,
})
.collect::<Vec<_>>();
......@@ -2137,7 +2137,7 @@ fn print_sidebar_section(
items.sort_unstable();
out.push_str(before);
for item in items.into_iter() {
write(out, item);
write(out, &item);
}
out.push_str(after);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册