From ba802709f828249a0b57cf3bfa220d4fd51d2ef7 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Sun, 12 Feb 2017 10:40:09 +0100 Subject: Rename functions to move away from 'into' suffix This is idiomatically used for type conversions. --- askama/src/generator.rs | 12 ++++++------ askama/src/lib.rs | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/askama/src/generator.rs b/askama/src/generator.rs index fbfec83..9d6252c 100644 --- a/askama/src/generator.rs +++ b/askama/src/generator.rs @@ -218,7 +218,7 @@ impl<'a> Generator<'a> { fn write_block(&mut self, ws1: &WS, name: &str, ws2: &WS) { self.flush_ws(ws1); - self.writeln(&format!("self.render_block_{}_into(writer);", name)); + self.writeln(&format!("self.render_block_{}_to(writer);", name)); self.prepare_ws(ws2); } @@ -226,7 +226,7 @@ impl<'a> Generator<'a> { ws2: &WS) { self.writeln("#[allow(unused_variables)]"); self.writeln(&format!( - "fn render_block_{}_into(&self, writer: &mut std::fmt::Write) {{", + "fn render_block_{}_to(&self, writer: &mut std::fmt::Write) {{", name)); self.indent(); self.prepare_ws(ws1); @@ -276,7 +276,7 @@ impl<'a> Generator<'a> { anno, ast.ident.as_ref(), anno)); self.indent(); - self.writeln("fn render_into(&self, writer: &mut std::fmt::Write) {"); + self.writeln("fn render_to(&self, writer: &mut std::fmt::Write) {"); self.indent(); self.handle(nodes); self.flush_ws(&WS(false, false)); @@ -305,9 +305,9 @@ impl<'a> Generator<'a> { anno, ast.ident.as_ref(), anno)); self.indent(); - self.writeln("fn render_into(&self, writer: &mut std::fmt::Write) {"); + self.writeln("fn render_to(&self, writer: &mut std::fmt::Write) {"); self.indent(); - self.writeln("self.render_trait_into(writer);"); + self.writeln("self.render_trait_to(writer);"); self.dedent(); self.writeln("}"); @@ -324,7 +324,7 @@ impl<'a> Generator<'a> { self.handle(blocks); - self.writeln("fn render_trait_into(&self, writer: &mut std::fmt::Write) {"); + self.writeln("fn render_trait_to(&self, writer: &mut std::fmt::Write) {"); self.indent(); self.handle(nodes); self.flush_ws(&WS(false, false)); diff --git a/askama/src/lib.rs b/askama/src/lib.rs index 99917ed..cbfdf46 100644 --- a/askama/src/lib.rs +++ b/askama/src/lib.rs @@ -3,10 +3,10 @@ extern crate nom; extern crate syn; pub trait Template { - fn render_into(&self, writer: &mut std::fmt::Write); + fn render_to(&self, writer: &mut std::fmt::Write); fn render(&self) -> String { let mut buf = String::new(); - self.render_into(&mut buf); + self.render_to(&mut buf); buf } } -- cgit