From 0c79c57347167854f896b69244160b9fb8e12659 Mon Sep 17 00:00:00 2001 From: splurf Date: Tue, 16 Jan 2024 13:52:41 -0500 Subject: [PATCH] refac --- src/json.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/json.rs b/src/json.rs index 9379026..7d9a298 100644 --- a/src/json.rs +++ b/src/json.rs @@ -8,10 +8,8 @@ use { #[derive(Deserialize, Debug)] pub struct DnsRecordResult { - #[serde(alias = "name")] - _name: String, - #[serde(alias = "type")] - _type: String, + name: String, + r#type: String, content: IpAddr, } @@ -117,12 +115,12 @@ impl TryInto for DnsRecordResult { Ok(Body { content: self.content, name: self - ._name + .name .split_once('.') .ok_or(Error::Invalid)? .0 .to_string(), - r#type: self._type, + r#type: self.r#type, }) } }