removed unneccessary references

This commit is contained in:
jannikac 2022-12-06 23:19:03 +01:00
parent cca2f3228f
commit 283cb589bd
2 changed files with 5 additions and 5 deletions

View File

@ -69,7 +69,7 @@ fn load_config_from<P: std::convert::AsRef<std::path::Path>>(path: P) -> anyhow:
pub fn load_config(opts: &opts::Opts) -> anyhow::Result<Config> {
let mut config = match &opts.config {
Some(config_path) => load_config_from(&config_path),
Some(config_path) => load_config_from(config_path),
None => {
let confpath = ProjectDirs::from("me", "kaangenc", "gandi-dynamic-dns")
.and_then(|dir| Some(PathBuf::from(dir.config_dir()).join("config.toml")))
@ -106,7 +106,7 @@ pub fn load_config(opts: &opts::Opts) -> anyhow::Result<Config> {
pub fn validate_config(config: &Config) -> anyhow::Result<()> {
for entry in &config.entry {
for entry_type in Config::types(&entry) {
for entry_type in Config::types(entry) {
if entry_type != "A" && entry_type != "AAAA" {
anyhow::bail!("Entry {} has invalid type {}", entry.name, entry_type);
}

View File

@ -68,11 +68,11 @@ async fn run<IP: IPSource>(base_url: &str, conf: Config) -> anyhow::Result<()> {
for entry in &conf.entry {
for entry_type in Config::types(entry) {
let fqdn = Config::fqdn(&entry, &conf).to_string();
let fqdn = Config::fqdn(entry, &conf).to_string();
let url = GandiAPI {
fqdn: &fqdn,
rrset_name: &entry.name,
rrset_type: &entry_type,
rrset_type: entry_type,
base_url,
}
.url();
@ -83,7 +83,7 @@ async fn run<IP: IPSource>(base_url: &str, conf: Config) -> anyhow::Result<()> {
};
let payload = APIPayload {
rrset_values: vec![ip.to_string()],
rrset_ttl: Config::ttl(&entry, &conf),
rrset_ttl: Config::ttl(entry, &conf),
};
let req = client.put(url).json(&payload);
let task_governor = governor.clone();