From 9ce9c101a10327b1eb6902133173119c3e0f3732 Mon Sep 17 00:00:00 2001 From: Gus Power Date: Wed, 21 May 2025 09:12:03 +0100 Subject: clippy: PascalCase enums. rename serde field names. --- src/dyndns_service/gandi.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/dyndns_service/gandi.rs') diff --git a/src/dyndns_service/gandi.rs b/src/dyndns_service/gandi.rs index 8851b2c..c8fe336 100644 --- a/src/dyndns_service/gandi.rs +++ b/src/dyndns_service/gandi.rs @@ -14,16 +14,17 @@ use serde_with::serde_as; // See https://api.gandi.net/docs/livedns/ for more info #[serde_as] #[derive(Debug, Deserialize, PartialEq, Serialize)] -pub struct Gandi { +pub struct GandiConfig { api_key: String, - #[serde(default = "Gandi::default_method")] + #[serde(default = "GandiConfig::default_method")] #[serde_as(as = "DisplayFromStr")] method: Method, - #[serde(default = "Gandi::default_record_type")] + #[serde(default = "GandiConfig::default_record_type")] record_type: DnsRecordType, } -impl Gandi { +impl GandiConfig { + #[cfg(test)] pub fn new(api_key: String) -> Self { Self { api_key, @@ -40,7 +41,7 @@ impl Gandi { } } -impl DynDnsServiceConfiguration for Gandi { +impl DynDnsServiceConfiguration for GandiConfig { fn get_service_url(&self) -> String { format!( "https://api.gandi.net/api/v5/domains/{domain}/records/{subdomain}/{record_type}", @@ -62,7 +63,7 @@ mod tests { "api_key": "SOME-API-KEY", }); - let gandi = serde_json::from_value::(input).unwrap(); + let gandi = serde_json::from_value::(input).unwrap(); assert_eq!(gandi.record_type, DnsRecordType::A); assert_eq!(gandi.method, Method::PUT); -- cgit v1.2.3