feat: updates

This commit is contained in:
2023-09-03 18:02:54 +08:00
parent a436a1f8a2
commit 8baf090964
6 changed files with 7 additions and 6 deletions

11
src/util/map_util.rs Normal file
View 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());
}
}