lunar-mining hace 4 años
padre
commit
3f8768ee69
Se han modificado 2 ficheros con 0 adiciones y 46 borrados
  1. 0 45
      bin/map/src/model.rs
  2. 0 1
      bin/map/src/ui.rs

+ 0 - 45
bin/map/src/model.rs

@@ -39,38 +39,6 @@ impl IdList {
         let node_id = Mutex::new(node_id);
         IdList { state: Mutex::new(ListState::default()), node_id }
     }
-
-    //pub async fn next(&mut self) {
-    //    let i = match self.state.lock().await.selected() {
-    //        Some(i) => {
-    //            if i >= self.node_id.lock().await.len() - 1 {
-    //                0
-    //            } else {
-    //                i + 1
-    //            }
-    //        }
-    //        None => 0,
-    //    };
-    //    self.state.lock().await.select(Some(i));
-    //}
-
-    //pub async fn previous(&mut self) {
-    //    let i = match self.state.lock().await.selected() {
-    //        Some(i) => {
-    //            if i == 0 {
-    //                self.node_id.lock().await.len() - 1
-    //            } else {
-    //                i - 1
-    //            }
-    //        }
-    //        None => 0,
-    //    };
-    //    self.state.lock().await.select(Some(i));
-    //}
-
-    //pub async fn unselect(&mut self) {
-    //    self.state.lock().await.select(None);
-    //}
 }
 
 pub struct InfoList {
@@ -86,19 +54,6 @@ impl InfoList {
 
         InfoList { index, infos }
     }
-
-    //pub async fn next(&mut self) {
-    //    let index = self.index.lock().await;
-    //    index = (index + 1) % index.len();
-    //}
-
-    //pub async fn previous(&mut self) {
-    //    if self.index.lock().await > 0 {
-    //        self.index.lock().await -= 1;
-    //    } else {
-    //        self.index.lock().await = self.infos.lock().await.len() - 1;
-    //    }
-    //}
 }
 
 pub type NodeId = u32;

+ 0 - 1
bin/map/src/ui.rs

@@ -29,7 +29,6 @@ pub fn ui<B: Backend>(f: &mut Frame<'_, B>, mut view: View) {
         .block(Block::default().borders(Borders::ALL))
         .highlight_style(Style::default().fg(Color::LightCyan).add_modifier(Modifier::BOLD));
 
-    // needs to be mutable. could
     f.render_stateful_widget(nodes, slice[0], &mut view.id_list.state);
 
     let index = view.info_list.index;