X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=src%2Fconfig.rs;h=d8a13d9fbaa75029901656b564a186c1ab1f4bc7;hb=e442b05740651836d1f250f1471518800e1a9e6e;hp=fb6b7cf7b82e7a28d38f4798e1c90f054bc092cd;hpb=e45d8f67336160ae61a9dc24f899752f5199a01b;p=gandi_dns_update.git diff --git a/src/config.rs b/src/config.rs index fb6b7cf..d8a13d9 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,6 +1,7 @@ -use ron::{ de::from_reader, ser::to_writer }; -use serde::{ Deserialize, Serialize }; -use std::{ fs::File, time }; +use std::{fs::File, time}; + +use ron::{de::from_reader, ser::to_writer}; +use serde::{Deserialize, Serialize}; use crate::error::Result; @@ -9,12 +10,17 @@ pub struct Config { pub delay_between_check: time::Duration, pub api_key: String, pub domains: Vec<(String, String)>, // Hostname, domain. - pub ttl: i32 + pub ttl: i32, } impl Config { pub fn default() -> Self { - Config { delay_between_check: time::Duration::from_secs(120), api_key: String::from(""), domains: Vec::new(), ttl: 300 } + Config { + delay_between_check: time::Duration::from_secs(120), + api_key: String::from(""), + domains: Vec::new(), + ttl: 300, + } } pub fn read(file_path: &str) -> Result { @@ -29,4 +35,4 @@ impl Config { } } } -} \ No newline at end of file +}