Insert data with custom key and value functions
(
tree: &mut BPlusTreeMap<i32, String>,
count: usize,
key_fn: F,
value_fn: G,
)
| 94 | |
| 95 | /// Insert data with custom key and value functions |
| 96 | pub fn insert_with_custom_fn<F, G>( |
| 97 | tree: &mut BPlusTreeMap<i32, String>, |
| 98 | count: usize, |
| 99 | key_fn: F, |
| 100 | value_fn: G, |
| 101 | ) where |
| 102 | F: Fn(usize) -> i32, |
| 103 | G: Fn(usize) -> String, |
| 104 | { |
| 105 | for i in 0..count { |
| 106 | let key = key_fn(i); |
| 107 | let value = value_fn(i); |
| 108 | tree.insert(key, value); |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | /// Insert sequential data start..end with string values |
| 113 | pub fn insert_range(tree: &mut BPlusTreeMap<i32, String>, start: usize, end: usize) { |
no test coverage detected