pub fn union(&self, other: &Environment) -> Environment {
        let mut vars = self.vars.clone();
        for (key, other_set) in &other.vars {
            if let Some(this_set) = vars.get(key) {
                let new_set = this_set.union(&other_set).cloned().collect();
                vars.insert(key.clone(), new_set);
            } else {
                vars.insert(key.clone(), other_set.clone());
            }
        }
        Environment { vars, ..self.clone() }
    }
/// Union between two environments
///
/// Combines all variables.
Union between two environments
Combines all variables.
Union between two environments Combines all variables .
pub fn union(&self, other: &Environment) -> Environment {
        let mut vars = self.vars.clone();
        for (key, other_set) in &other.vars {
            if let Some(this_set) = vars.get(key) {
                let new_set = this_set.union(&other_set).cloned().collect();
                vars.insert(key.clone(), new_set);
            } else {
                vars.insert(key.clone(), other_set.clone());
            }
        }
        Environment { vars, ..self.clone() }
    }
pub fn union ( & self , other : & Environment ) -> Environment { let mut vars = self . vars . clone ( ) ; for ( key , other_set ) in & other . vars { if let Some ( this_set ) = vars . get ( key ) { let new_set = this_set . union ( & other_set ) . cloned ( ) . collect ( ) ; vars . insert ( key . clone ( ) , new_set ) ; } else { vars . insert ( key . clone ( ) , other_set . clone ( ) ) ; } } Environment { vars , .. self . clone ( ) } }
Union between two environments
Combines all variables.
Union between two environments Combines all variables .
&self
other
&Environment