Browse Source

map: fixed import error and cleaned up

lunar-mining 4 năm trước cách đây
mục cha
commit
4b4538a902
2 tập tin đã thay đổi với 1 bổ sung65 xóa
  1. 1 1
      bin/map/src/main.rs
  2. 0 64
      bin/map/src/node_info.rs

+ 1 - 1
bin/map/src/main.rs

@@ -18,7 +18,7 @@ use tui::{
 
 
 pub mod app;
 pub mod app;
 pub mod list;
 pub mod list;
-pub mod node;
+pub mod node_info;
 pub mod types;
 pub mod types;
 pub mod ui;
 pub mod ui;
 
 

+ 0 - 64
bin/map/src/node_info.rs

@@ -18,15 +18,6 @@ impl NodeInfoView {
         NodeInfoView { index }
         NodeInfoView { index }
     }
     }
 
 
-    //pub fn make_info() -> Vec<String> {
-    //    let mut node_info = Vec::new();
-    //    for num in 1..10 {
-    //        let new_info = format!("Connections: {}", num);
-    //        node_info.push(new_info.to_string());
-    //    }
-    //    node_info
-    //}
-
     pub fn next(&mut self) {
     pub fn next(&mut self) {
         //self.index = (self.index + 1) % self.info.len();
         //self.index = (self.index + 1) % self.info.len();
     }
     }
@@ -54,59 +45,4 @@ impl NodeInfo {
         let is_active = false;
         let is_active = false;
         NodeInfo { id: String::new(), connections, is_active, last_message: String::new() }
         NodeInfo { id: String::new(), connections, is_active, last_message: String::new() }
     }
     }
-
-    //pub fn make_info() -> Vec<String> {
-    //    let mut node_info = Vec::new();
-    //    for num in 1..10 {
-    //        let new_info = format!("Connections: {}", num);
-    //        node_info.push(new_info.to_string());
-    //    }
-    //    node_info
-    //}
-
-    //pub fn next(&mut self) {
-    //    self.index = (self.index + 1) % self.info.len();
-    //}
-
-    //pub fn previous(&mut self) {
-    //    if self.index > 0 {
-    //        self.index -= 1;
-    //    } else {
-    //        self.index = self.info.len() - 1;
-    //    }
-    //}
 }
 }
-
-// Make a string
-// Type alias
-//#[derive(Clone)]
-//pub struct NodeId {
-//    // TODO: make this plural
-//    pub id: Vec<String>,
-//}
-//
-//impl NodeId {
-//    pub fn new() -> NodeId {
-//        let id = Self::get_node_id();
-//        NodeId { id }
-//    }
-//    fn get_node_id() -> Vec<String> {
-//        let mut node_list = Vec::new();
-//        for num in 1..100 {
-//            let mut rng = rand::thread_rng();
-//            let new_nodes = format!("Node: {}", rng.gen::<u32>());
-//            node_list.push(new_nodes);
-//        }
-//        node_list
-//    }
-//}
-
-// fn get_node_info() -> Vec<String> {
-//     let mut node_info = Vec::new();
-//     for _num in 1..100 {
-//         //let new_info = format!("\nConnections: {}\n", num);
-//         let new_info = "";
-//         node_info.push(new_info.to_string());
-//     }
-//     node_info
-// }