aboutsummaryrefslogtreecommitdiff
path: root/src/consul.rs
diff options
context:
space:
mode:
authorQuentin <quentin@dufour.io>2021-09-20 16:06:02 +0200
committerQuentin <quentin@dufour.io>2021-09-20 16:06:02 +0200
commit4d4d453afa3edafe71db2ae60171b8696b38a3c9 (patch)
tree64a54012efbac76bca6c5f0d8214fdae44743bc8 /src/consul.rs
parent2bbc9109991f8bb79a09a965a1d2779e1749b25b (diff)
parent68cb4d5482649baca3a79d3fd0e3449a6af0533b (diff)
downloaddiplonat-4d4d453afa3edafe71db2ae60171b8696b38a3c9.tar.gz
diplonat-4d4d453afa3edafe71db2ae60171b8696b38a3c9.zip
Merge pull request 'Extensively use rustfmt' (#11) from quality/rustfmt into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/diplonat/pulls/11
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)
}
}