aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-02-12 10:40:09 +0100
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-02-12 10:40:09 +0100
commitba802709f828249a0b57cf3bfa220d4fd51d2ef7 (patch)
tree91e95dfaeb6735165a6490bcfb4b0ac918cbc2db
parent7b03379b7906ff952fc5253ff224101303014281 (diff)
downloadaskama-ba802709f828249a0b57cf3bfa220d4fd51d2ef7.tar.gz
askama-ba802709f828249a0b57cf3bfa220d4fd51d2ef7.tar.bz2
askama-ba802709f828249a0b57cf3bfa220d4fd51d2ef7.zip
Rename functions to move away from 'into' suffix
This is idiomatically used for type conversions.
-rw-r--r--askama/src/generator.rs12
-rw-r--r--askama/src/lib.rs4
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
}
}