From 0e643bc9c2372da6a342047adc142e952eebf289 Mon Sep 17 00:00:00 2001 From: Kaan Barmore-Genc Date: Mon, 22 Aug 2022 22:15:28 -0400 Subject: [PATCH] fix bad format --- src/config.rs | 4 +++- src/ip_source/ip_source.rs | 4 ++-- src/ip_source/ipify.rs | 18 +++++++++--------- src/ip_source/mod.rs | 2 +- src/opts.rs | 1 - 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/config.rs b/src/config.rs index 66d2e3b..59f5e37 100644 --- a/src/config.rs +++ b/src/config.rs @@ -13,7 +13,9 @@ pub struct Entry { ttl: Option, } -fn default_ttl() -> u32 { return 300; } +fn default_ttl() -> u32 { + return 300; +} #[derive(Deserialize, Debug)] pub struct Config { diff --git a/src/ip_source/ip_source.rs b/src/ip_source/ip_source.rs index 6f0bef8..1117626 100644 --- a/src/ip_source/ip_source.rs +++ b/src/ip_source/ip_source.rs @@ -3,6 +3,6 @@ use async_trait::async_trait; #[async_trait] pub trait IPSource { - async fn get_ipv4() -> anyhow::Result; - async fn get_ipv6() -> anyhow::Result; + async fn get_ipv4() -> anyhow::Result; + async fn get_ipv6() -> anyhow::Result; } diff --git a/src/ip_source/ipify.rs b/src/ip_source/ipify.rs index ba4736e..f418562 100644 --- a/src/ip_source/ipify.rs +++ b/src/ip_source/ipify.rs @@ -6,17 +6,17 @@ use super::ip_source::IPSource; pub(crate) struct IPSourceIpify {} async fn get_ip(api_url: &str) -> anyhow::Result { - let response = reqwest::get(api_url).await?; - let text = response.text().await?; - Ok(text) + let response = reqwest::get(api_url).await?; + let text = response.text().await?; + Ok(text) } #[async_trait] impl IPSource for IPSourceIpify { - async fn get_ipv4() -> anyhow::Result { - get_ip("https://api.ipify.org").await - } - async fn get_ipv6() -> anyhow::Result { - get_ip("https://api6.ipify.org").await - } + async fn get_ipv4() -> anyhow::Result { + get_ip("https://api.ipify.org").await + } + async fn get_ipv6() -> anyhow::Result { + get_ip("https://api6.ipify.org").await + } } diff --git a/src/ip_source/mod.rs b/src/ip_source/mod.rs index af49f3c..f8070e9 100644 --- a/src/ip_source/mod.rs +++ b/src/ip_source/mod.rs @@ -1,2 +1,2 @@ pub(crate) mod ip_source; -pub(crate) mod ipify; \ No newline at end of file +pub(crate) mod ipify; diff --git a/src/opts.rs b/src/opts.rs index 85e4e87..65c6808 100644 --- a/src/opts.rs +++ b/src/opts.rs @@ -7,5 +7,4 @@ pub struct Opts { /// The path to the configuration file. #[clap(long)] pub config: Option, - }