This commit is contained in:
Nathan Sobo 2022-03-10 11:32:14 -07:00
parent ac1eb19f83
commit e6b1fea117
9 changed files with 280 additions and 79 deletions

View file

@ -31,6 +31,10 @@ impl<K: Clone + Debug + Default + Ord, V: Clone + Debug> TreeMap<K, V> {
Self(tree)
}
pub fn is_empty(&self) -> bool {
self.0.is_empty()
}
pub fn get<'a>(&self, key: &'a K) -> Option<&V> {
let mut cursor = self.0.cursor::<MapKeyRef<'_, K>>();
cursor.seek(&MapKeyRef(Some(key)), Bias::Left, &());