提交 04dc72ee 编写于 作者: M Mark Rousskov

Remove unnecessary Buffer in layout::render

上级 75528f26
......@@ -3,7 +3,6 @@
use crate::externalfiles::ExternalHtml;
use crate::html::render::SlashChecker;
use crate::html::format::Buffer;
#[derive(Clone)]
pub struct Layout {
......@@ -38,10 +37,8 @@ pub fn render<T: fmt::Display, S: fmt::Display>(
t: &T,
themes: &[PathBuf],
) -> String {
let mut dst = Buffer::html();
let static_root_path = page.static_root_path.unwrap_or(page.root_path);
write!(dst,
"<!DOCTYPE html>\
format!("<!DOCTYPE html>\
<html lang=\"en\">\
<head>\
<meta charset=\"utf-8\">\
......@@ -239,8 +236,7 @@ pub fn render<T: fmt::Display, S: fmt::Display>(
} else {
""
},
);
dst.into_inner()
)
}
pub fn redirect(url: &str) -> String {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册