set

Function set 

Source
pub fn set(object: &mut HashMap<String, String>, key: &str, value: &str)
Expand description

Sets the value at key of object. If the key doesn’t exist, it’s created.

Note: This function mutates object.

§Examples

use lorust::set;
use std::collections::HashMap;

let mut object: HashMap<String, String> = HashMap::new();
set(&mut object, "key", "value");
assert_eq!(object.get("key").unwrap(), "value");