Silence sum_tree warnings

Max Brunsfeld created

* Remove unused enum variant
* Add #[allow(unused)] for non-trivial methods

Change summary

zed/src/sum_tree/cursor.rs | 2 ++
zed/src/sum_tree/mod.rs    | 6 +++---
2 files changed, 5 insertions(+), 3 deletions(-)

Detailed changes

zed/src/sum_tree/cursor.rs 🔗

@@ -133,6 +133,7 @@ where
         None
     }
 
+    #[allow(unused)]
     pub fn prev(&mut self) {
         assert!(self.did_seek, "Must seek before calling this method");
 
@@ -385,6 +386,7 @@ where
         self.seek_internal::<()>(pos, bias, &mut SeekAggregate::None)
     }
 
+    #[allow(unused)]
     pub fn seek_forward(&mut self, pos: &S, bias: SeekBias) -> bool {
         self.seek_internal::<()>(pos, bias, &mut SeekAggregate::None)
     }

zed/src/sum_tree/mod.rs 🔗

@@ -54,6 +54,7 @@ impl<T: Item> SumTree<T> {
         tree
     }
 
+    #[allow(unused)]
     pub fn items(&self) -> Vec<T> {
         let mut cursor = self.cursor::<(), ()>();
         cursor.descend_to_first_item(self, |_| true);
@@ -320,6 +321,7 @@ impl<T: Item> SumTree<T> {
 }
 
 impl<T: KeyedItem> SumTree<T> {
+    #[allow(unused)]
     pub fn insert(&mut self, item: T) {
         *self = {
             let mut cursor = self.cursor::<T::Key, ()>();
@@ -363,7 +365,6 @@ impl<T: KeyedItem> SumTree<T> {
                     Edit::Insert(item) => {
                         buffered_items.push(item.clone());
                     }
-                    Edit::Remove(_) => {}
                 }
             }
 
@@ -445,13 +446,12 @@ impl<T: Item> Node<T> {
 #[derive(Debug)]
 pub enum Edit<T: KeyedItem> {
     Insert(T),
-    Remove(T),
 }
 
 impl<T: KeyedItem> Edit<T> {
     fn key(&self) -> T::Key {
         match self {
-            Edit::Insert(item) | Edit::Remove(item) => item.key(),
+            Edit::Insert(item) => item.key(),
         }
     }
 }