feat: updates
This commit is contained in:
11
src/util/map_util.rs
Normal file
11
src/util/map_util.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
pub(crate) trait BTreeMapAddKv<K: Ord, V> {
|
||||
fn insert_kv(&mut self, key: impl Into<K>, value: impl Into<V>);
|
||||
}
|
||||
|
||||
impl<K: Ord, V> BTreeMapAddKv<K, V> for BTreeMap<K, V> {
|
||||
fn insert_kv(&mut self, key: impl Into<K>, value: impl Into<V>) {
|
||||
self.insert(key.into(), value.into());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user