From 7d478d997620c0af41a6ffb8b3f29dc6dda2cb98 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Mon, 20 Sep 2021 15:00:31 +0200 Subject: Stricter Rust formating rules and build in the CI --- src/consul.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/consul.rs') 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 { let url = match self.idx { @@ -44,6 +43,6 @@ impl Consul { }; let resp: CatalogNode = http.json().await?; - return Ok(resp); + return Ok(resp) } } -- cgit v1.2.3