aboutsummaryrefslogtreecommitdiff
path: root/src/consul.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/consul.rs')
-rw-r--r--src/consul.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/consul.rs b/src/consul.rs
index 1123996..4e6fe5d 100644
--- a/src/consul.rs
+++ b/src/consul.rs
@@ -1,6 +1,7 @@
+use std::collections::HashMap;
+
use anyhow::{anyhow, Result};
use serde::{Deserialize, Serialize};
-use std::collections::HashMap;
#[derive(Serialize, Deserialize, Debug)]
pub struct ServiceEntry {
@@ -24,12 +25,10 @@ impl Consul {
client: reqwest::Client::new(),
url: url.to_string(),
idx: None,
- };
+ }
}
- pub fn watch_node_reset(&mut self) -> () {
- self.idx = None;
- }
+ pub fn watch_node_reset(&mut self) -> () { self.idx = None; }
pub async fn watch_node(&mut self, host: &str) -> Result<CatalogNode> {
let url = match self.idx {
@@ -44,6 +43,6 @@ impl Consul {
};
let resp: CatalogNode = http.json().await?;
- return Ok(resp);
+ return Ok(resp)
}
}