Kaynağa Gözat

map: cargo +nightly fmt

lunar-mining 4 yıl önce
ebeveyn
işleme
36bfc6a6c0
4 değiştirilmiş dosya ile 11 ekleme ve 8 silme
  1. 2 6
      bin/map/src/app.rs
  2. 4 0
      bin/map/src/list.rs
  3. 1 2
      bin/map/src/main.rs
  4. 4 0
      bin/map/src/node_info.rs

+ 2 - 6
bin/map/src/app.rs

@@ -71,12 +71,8 @@ impl App {
 
     pub async fn update(mut self, node_vec: Vec<NodeInfo>) -> App {
         let node_info = NodeInfoView::new(node_vec.clone());
-        
-        let ids = vec![
-            node_vec[0].id.clone(),
-            node_vec[1].id.clone(),
-            node_vec[2].id.clone(),
-        ];
+
+        let ids = vec![node_vec[0].id.clone(), node_vec[1].id.clone(), node_vec[2].id.clone()];
 
         let node_list = NodeIdList::new(ids);
         App { node_list, node_info }

+ 4 - 0
bin/map/src/list.rs

@@ -44,3 +44,7 @@ impl NodeIdList {
         self.state.select(None);
     }
 }
+
+//pub async fn add_seen(&self, id: u32) {
+//    self.privmsg_ids.lock().await.insert(id);
+//}

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

@@ -164,8 +164,7 @@ async fn update(mut app: App, reply: Value) -> Result<()> {
         //let node_list = NodeIdList::new(ids);
         //println!("{}", test);
         // do something
-    }
-    else {
+    } else {
         // TODO: error handling
         println!("Reply is an error");
     }

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

@@ -39,3 +39,7 @@ impl NodeInfo {
         NodeInfo { id: String::new(), connections, is_active, last_message: String::new() }
     }
 }
+
+//pub async fn add_seen(&self, id: u32) {
+//    self.privmsg_ids.lock().await.insert(id);
+//}