feat: updates

This commit is contained in:
2023-09-03 18:00:07 +08:00
parent 191ff1df2e
commit a436a1f8a2
7 changed files with 37 additions and 17 deletions

11
src/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());
}
}