From 54f0549f8001c79cd9ab4a72e7a479140d1e9ffe Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Thu, 7 Sep 2017 20:42:55 +0200 Subject: Rename and document top-level Generator::build() method --- askama_shared/src/generator.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'askama_shared/src') diff --git a/askama_shared/src/generator.rs b/askama_shared/src/generator.rs index 9ccbbbd..e92a2c6 100644 --- a/askama_shared/src/generator.rs +++ b/askama_shared/src/generator.rs @@ -13,7 +13,7 @@ use syn; pub fn generate(input: &TemplateInput, nodes: &[Node]) -> String { - Generator::default().result(&State::new(input, nodes)) + Generator::default().build(&State::new(input, nodes)) } struct State<'a> { @@ -126,7 +126,8 @@ impl<'a> Generator<'a> { Self::new(locals, self.indent) } - fn result(mut self, state: &'a State) -> String { + // Takes a State and generates the relevant implementations. + fn build(mut self, state: &'a State) -> String { if !state.blocks.is_empty() { if !state.derived { self.define_trait(state); -- cgit