mirror of
https://github.com/SeriousBug/gandi-live-dns-rust
synced 2024-11-16 12:18:56 -06:00
fix bad format
This commit is contained in:
parent
f47b3f09e7
commit
0e643bc9c2
|
@ -13,7 +13,9 @@ pub struct Entry {
|
|||
ttl: Option<u32>,
|
||||
}
|
||||
|
||||
fn default_ttl() -> u32 { return 300; }
|
||||
fn default_ttl() -> u32 {
|
||||
return 300;
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Debug)]
|
||||
pub struct Config {
|
||||
|
|
|
@ -3,6 +3,6 @@ use async_trait::async_trait;
|
|||
|
||||
#[async_trait]
|
||||
pub trait IPSource {
|
||||
async fn get_ipv4() -> anyhow::Result<String>;
|
||||
async fn get_ipv6() -> anyhow::Result<String>;
|
||||
async fn get_ipv4() -> anyhow::Result<String>;
|
||||
async fn get_ipv6() -> anyhow::Result<String>;
|
||||
}
|
||||
|
|
|
@ -6,17 +6,17 @@ use super::ip_source::IPSource;
|
|||
pub(crate) struct IPSourceIpify {}
|
||||
|
||||
async fn get_ip(api_url: &str) -> anyhow::Result<String> {
|
||||
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<String> {
|
||||
get_ip("https://api.ipify.org").await
|
||||
}
|
||||
async fn get_ipv6() -> anyhow::Result<String> {
|
||||
get_ip("https://api6.ipify.org").await
|
||||
}
|
||||
async fn get_ipv4() -> anyhow::Result<String> {
|
||||
get_ip("https://api.ipify.org").await
|
||||
}
|
||||
async fn get_ipv6() -> anyhow::Result<String> {
|
||||
get_ip("https://api6.ipify.org").await
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
pub(crate) mod ip_source;
|
||||
pub(crate) mod ipify;
|
||||
pub(crate) mod ipify;
|
||||
|
|
|
@ -7,5 +7,4 @@ pub struct Opts {
|
|||
/// The path to the configuration file.
|
||||
#[clap(long)]
|
||||
pub config: Option<String>,
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue