pub fn insert_extra_vars(&mut self, vars: &Option<Vec<String>>) {
        if vars.is_some() {
            let vars = vars.as_ref().unwrap();

            // each var should have this form: 'var:value'
            for var in vars {
                // split at char ':'
                let splitted: Vec<&str> = var.split(':').collect();

                // if we don't find the equals sign just loop
                if splitted.len() != 2 {
                    continue;
                }

                // now it's safe to insert
                self.global_vars
                    .insert(splitted[0].to_string(), splitted[1].to_string());
            }
        }
    }
/// Add optional extra global variables coming from the command line
Add optional extra global variables coming from the command line
Add optional extra global variables coming from the command line
pub fn insert_extra_vars(&mut self, vars: &Option<Vec<String>>) {
        if vars.is_some() {
            let vars = vars.as_ref().unwrap();
            // each var should have this form: 'var:value'
            for var in vars {
                // split at char ':'
                let splitted: Vec<&str> = var.split(':').collect();
                // if we don't find the equals sign just loop
                if splitted.len() != 2 {
                    continue;
                }
                // now it's safe to insert
                self.global_vars
                    .insert(splitted[0].to_string(), splitted[1].to_string());
            }
        }
    }
pub fn insert_extra_vars ( & mut self , vars : & Option < Vec < String > > ) { if vars . is_some ( ) { let vars = vars . as_ref ( ) . unwrap ( ) ; // each var should have this form: 'var:value' for var in vars { // split at char ':' let splitted : Vec < & str > = var . split ( ':' ) . collect ( ) ; // if we don't find the equals sign just loop if splitted . len ( ) != 2 { continue ; } // now it's safe to insert self . global_vars . insert ( splitted [ 0 ] . to_string ( ) , splitted [ 1 ] . to_string ( ) ) ; } } }
Add optional extra global variables coming from the command line
Add optional extra global variables coming from the command line
&mut self
vars
&Option<Vec<String>>
&mut self
vars
&Option<Vec<String>>