From 344e06f7c8e3c830d365adf34b9eba2d21cdc4a9 Mon Sep 17 00:00:00 2001 From: lunar-mining Date: Sat, 19 Mar 2022 07:12:36 +0100 Subject: [PATCH] rename Map struct to DNetView --- bin/dnetview/src/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/dnetview/src/main.rs b/bin/dnetview/src/main.rs index 300561a51..2a043fcb9 100644 --- a/bin/dnetview/src/main.rs +++ b/bin/dnetview/src/main.rs @@ -34,11 +34,11 @@ use dnetview::{ Model, View, }; -struct Map { +struct DNetView { url: Url, } -impl Map { +impl DNetView { pub fn new(url: Url) -> Self { Self { url } } @@ -134,7 +134,7 @@ async fn main() -> Result<()> { async fn run_rpc(config: &DnvConfig, ex: Arc>, model: Arc) -> Result<()> { for node in config.nodes.clone() { - let client = Map::new(Url::parse(&node.node_id)?); + let client = DNetView::new(Url::parse(&node.node_id)?); ex.spawn(poll(client, model.clone())).detach(); } Ok(()) @@ -143,7 +143,7 @@ async fn run_rpc(config: &DnvConfig, ex: Arc>, model: Arc) - // TODO: clean up into seperate functions. // TODO: replace if/else with match where possible // TODO: test unwraps will never ever crash -async fn poll(client: Map, model: Arc) -> Result<()> { +async fn poll(client: DNetView, model: Arc) -> Result<()> { loop { let reply = client.get_info().await?;