1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
use HashMap;
/// Creates a new HashMap composed of the picked properties from the source HashMap.
///
/// # Arguments
///
/// * `object` - The source HashMap.
/// * `paths` - The property keys to pick.
///
/// # Returns
///
/// A new HashMap containing the picked properties.
///
/// # Examples
///
/// ```
/// use lorust::pick;
/// use std::collections::HashMap;
///
/// let mut object = HashMap::new();
/// let binding = "1".to_string();
/// object.insert("a", &binding);
/// let binding = "2".to_string();
/// object.insert("b", &binding);
/// let binding = "3".to_string();
/// object.insert("c", &binding);
///
/// let picked = pick(&object, &["a", "c"]);
///
/// assert_eq!(picked.get("a"), Some(&String::from("1")));
/// assert_eq!(picked.get("c"), Some(&String::from("3")));
/// assert_eq!(picked.get("b"), None);
/// ```