aboutsummaryrefslogtreecommitdiff
path: root/src/consul.rs
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2021-09-20 15:00:31 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2021-09-20 15:13:16 +0200
commit7d478d997620c0af41a6ffb8b3f29dc6dda2cb98 (patch)
tree03b08b4c27401b46c3e64c53e3469d2803efa3e9 /src/consul.rs
parent2bbc9109991f8bb79a09a965a1d2779e1749b25b (diff)
downloaddiplonat-7d478d997620c0af41a6ffb8b3f29dc6dda2cb98.tar.gz
diplonat-7d478d997620c0af41a6ffb8b3f29dc6dda2cb98.zip
Stricter Rust formating rules and build in the CI
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)
}
}