diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-02-12 20:34:37 +0100 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-02-12 20:34:37 +0100 |
commit | 7b831bd79fd1a1b3f6149420b34df1a19644554c (patch) | |
tree | d6c97a9db8b66d5ecba7828675b0cb912b098ed3 | |
parent | 2befc17e3deeabcb601c85f0d3e83ced66f4e3f5 (diff) | |
download | askama-7b831bd79fd1a1b3f6149420b34df1a19644554c.tar.gz askama-7b831bd79fd1a1b3f6149420b34df1a19644554c.tar.bz2 askama-7b831bd79fd1a1b3f6149420b34df1a19644554c.zip |
Remove lifetime annotations from trait definition
-rw-r--r-- | askama/src/generator.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/askama/src/generator.rs b/askama/src/generator.rs index 7e84ce5..c8d9ce4 100644 --- a/askama/src/generator.rs +++ b/askama/src/generator.rs @@ -337,11 +337,10 @@ impl<'a> Generator<'a> { self.writeln("}"); } - fn define_trait(&mut self, ast: &syn::DeriveInput, path: &str, - block_names: &[&str], nodes: &'a [Node]) { - let anno = annotations(&ast.generics); - self.writeln(&format!("trait{} TraitFrom{}{} {{", anno, - path_as_identifier(path), anno)); + fn define_trait(&mut self, path: &str, block_names: &[&str], + nodes: &'a [Node]) { + self.writeln(&format!("trait TraitFrom{} {{", + path_as_identifier(path))); self.indent(); for bname in block_names { @@ -394,7 +393,7 @@ pub fn generate(ast: &syn::DeriveInput, path: &str, mut nodes: Vec<Node>) -> Str if !blocks.is_empty() { gen.struct_impl(ast, &blocks); if base.is_none() { - gen.define_trait(ast, path, &block_names, &content); + gen.define_trait(path, &block_names, &content); } let tmpl_path = match base { Some(Expr::StrLit(base_path)) => { base_path }, |