diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2018-07-25 14:12:51 +0100 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2018-07-25 14:12:51 +0100 |
commit | fdd90a4e1cf259422d3f5dc1c866068026b9e71e (patch) | |
tree | 5365180c30c91c7b2d78fb84f235c9d2702b0195 | |
parent | 5086409fbf382fd858144c5f662ccf1d0a00f41e (diff) | |
download | askama-fdd90a4e1cf259422d3f5dc1c866068026b9e71e.tar.gz askama-fdd90a4e1cf259422d3f5dc1c866068026b9e71e.tar.bz2 askama-fdd90a4e1cf259422d3f5dc1c866068026b9e71e.zip |
Use write!() macro instead of write_fmt() method
Diffstat (limited to '')
-rw-r--r-- | askama_derive/src/generator.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/askama_derive/src/generator.rs b/askama_derive/src/generator.rs index 7cdad22..24370fa 100644 --- a/askama_derive/src/generator.rs +++ b/askama_derive/src/generator.rs @@ -585,14 +585,14 @@ impl<'a> Generator<'a> { use self::DisplayWrap::*; use super::input::EscapeMode::*; - buf.writeln("writer.write_fmt(format_args!(\"{}\", &{"); + buf.writeln("write!(writer, \"{}\", &{"); buf.write(&match (wrapped, &self.input.escaping) { (Wrapped, &Html) | (Wrapped, &None) | (Unwrapped, &None) => expr_buf.buf, (Unwrapped, &Html) => format!("::askama::MarkupDisplay::from(&{})", expr_buf.buf), }); buf.writeln(""); buf.dedent(); - buf.writeln("}))?;"); + buf.writeln("})?;"); } fn write_lit(&mut self, buf: &mut Buffer, lws: &'a str, val: &str, rws: &'a str) { |