/** If key doesn't exist then an empty string entry will be created. */
If key doesn't exist then an empty string entry will be created.
If key doesn ' t exist then an empty string entry will be created .
pub fn replace<S>(&mut self, key: &S, old_value: Value, new_value: Value)
    where
        S: ?Sized + Hash + Eq + ToString,
        Key: Borrow<S>,
    {
        if !self.env.contains_key(key) {
            self.env.insert(key.to_string(), "".to_string());
        }
        let value = self.env[key].clone();
        if value.contains(&old_value) {
            self.env
                .insert(key.to_string(), value.replace(&old_value, &new_value));
        }
    }
pub fn replace < S > ( & mut self , key : & S , old_value : Value , new_value : Value ) where S : ? Sized + Hash + Eq + ToString , Key : Borrow < S > , { if ! self . env . contains_key ( key ) { self . env . insert ( key . to_string ( ) , " " . to_string ( ) ) ; } let value = self . env [ key ] . clone ( ) ; if value . contains ( & old_value ) { self . env . insert ( key . to_string ( ) , value . replace ( & old_value , & new_value ) ) ; } }
If key doesn't exist then an empty string entry will be created.
If key doesn ' t exist then an empty string entry will be created .
&mut self
<not_specific>
key
&S
<not_specific>
old_value
Value
<not_specific>
new_value
Value
<not_specific>