mirror of
https://github.com/askama-rs/askama.git
synced 2025-10-02 15:25:19 +00:00
Remove lifetime annotations from trait definition
This commit is contained in:
parent
2befc17e3d
commit
7b831bd79f
@ -337,11 +337,10 @@ impl<'a> Generator<'a> {
|
|||||||
self.writeln("}");
|
self.writeln("}");
|
||||||
}
|
}
|
||||||
|
|
||||||
fn define_trait(&mut self, ast: &syn::DeriveInput, path: &str,
|
fn define_trait(&mut self, path: &str, block_names: &[&str],
|
||||||
block_names: &[&str], nodes: &'a [Node]) {
|
nodes: &'a [Node]) {
|
||||||
let anno = annotations(&ast.generics);
|
self.writeln(&format!("trait TraitFrom{} {{",
|
||||||
self.writeln(&format!("trait{} TraitFrom{}{} {{", anno,
|
path_as_identifier(path)));
|
||||||
path_as_identifier(path), anno));
|
|
||||||
self.indent();
|
self.indent();
|
||||||
|
|
||||||
for bname in block_names {
|
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() {
|
if !blocks.is_empty() {
|
||||||
gen.struct_impl(ast, &blocks);
|
gen.struct_impl(ast, &blocks);
|
||||||
if base.is_none() {
|
if base.is_none() {
|
||||||
gen.define_trait(ast, path, &block_names, &content);
|
gen.define_trait(path, &block_names, &content);
|
||||||
}
|
}
|
||||||
let tmpl_path = match base {
|
let tmpl_path = match base {
|
||||||
Some(Expr::StrLit(base_path)) => { base_path },
|
Some(Expr::StrLit(base_path)) => { base_path },
|
||||||
|
Loading…
x
Reference in New Issue
Block a user