Skip to content

Commit

Permalink
Use write_all in generated code instead of write!()
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Jun 22, 2018
1 parent cba4b68 commit 93da8c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/templateexpression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ impl TemplateExpression {
match *self {
TemplateExpression::Comment => String::new(),
TemplateExpression::Text { ref text } => {
format!("write!(out, {:?})?;\n", text)
format!("out.write_all({:?}.as_bytes())?;\n", text)
}
TemplateExpression::Expression { ref expr } => {
format!("{}.to_html(out)?;\n", expr)
Expand Down

0 comments on commit 93da8c2

Please sign in to comment.