pub fn extend(&mut self, other: &Tera) -> Result<()> {
        for (name, template) in &other.templates {
            if !self.templates.contains_key(name) {
                let mut tpl = template.clone();
                tpl.from_extend = true;
                self.templates.insert(name.to_string(), tpl);
            }
        }

        for (name, filter) in &other.filters {
            if !self.filters.contains_key(name) {
                self.filters.insert(name.to_string(), *filter);
            }
        }

        for (name, tester) in &other.testers {
            if !self.testers.contains_key(name) {
                self.testers.insert(name.to_string(), *tester);
            }
        }

        self.build_inheritance_chains()?;
        self.check_macro_files()
    }
/// Use that method when you want to add a given Tera instance templates/filters/testers
/// to your own. If a template/filter/tester with the same name already exists in your instance,
/// it will not be overwritten.
///
///```rust,ignore
/// // add all the templates from FRAMEWORK_TERA
/// // except the ones that have an identical name to the ones in `my_tera`
/// my_tera.extend(&FRAMEWORK_TERA);
///```
Use that method when you want to add a given Tera instance templates/filters/testers
to your own. If a template/filter/tester with the same name already exists in your instance,
it will not be overwritten.


Use that method when you want to add a given Tera instance templates / filters / testers to your own . If a template / filter / tester with the same name already exists in your instance it will not be overwritten .
pub fn extend(&mut self, other: &Tera) -> Result<()> {
        for (name, template) in &other.templates {
            if !self.templates.contains_key(name) {
                let mut tpl = template.clone();
                tpl.from_extend = true;
                self.templates.insert(name.to_string(), tpl);
            }
        }
        for (name, filter) in &other.filters {
            if !self.filters.contains_key(name) {
                self.filters.insert(name.to_string(), *filter);
            }
        }
        for (name, tester) in &other.testers {
            if !self.testers.contains_key(name) {
                self.testers.insert(name.to_string(), *tester);
            }
        }
        self.build_inheritance_chains()?;
        self.check_macro_files()
    }
pub fn extend ( & mut self , other : & Tera ) -> Result < ( ) > { for ( name , template ) in & other . templates { if ! self . templates . contains_key ( name ) { let mut tpl = template . clone ( ) ; tpl . from_extend = true ; self . templates . insert ( name . to_string ( ) , tpl ) ; } } for ( name , filter ) in & other . filters { if ! self . filters . contains_key ( name ) { self . filters . insert ( name . to_string ( ) , * filter ) ; } } for ( name , tester ) in & other . testers { if ! self . testers . contains_key ( name ) { self . testers . insert ( name . to_string ( ) , * tester ) ; } } self . build_inheritance_chains ( ) ? ; self . check_macro_files ( ) }
Use that method when you want to add a given Tera instance templates/filters/testers
to your own.
Use that method when you want to add a given Tera instance templates / filters / testers to your own .
&mut self
other
&Tera
&mut self
other
&Tera