diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-09-07 20:42:55 +0200 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-09-07 20:42:55 +0200 |
commit | 54f0549f8001c79cd9ab4a72e7a479140d1e9ffe (patch) | |
tree | 865970da05a6d5c347039a8ca821100d7516b765 | |
parent | 36b06915177ccc8da1cdefa46fdde7ff44938ef8 (diff) | |
download | askama-54f0549f8001c79cd9ab4a72e7a479140d1e9ffe.tar.gz askama-54f0549f8001c79cd9ab4a72e7a479140d1e9ffe.tar.bz2 askama-54f0549f8001c79cd9ab4a72e7a479140d1e9ffe.zip |
Rename and document top-level Generator::build() method
-rw-r--r-- | askama_shared/src/generator.rs | 5 |
1 files changed, 3 insertions, 2 deletions
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); |