Skip to content

Commit

Permalink
refac
Browse files Browse the repository at this point in the history
  • Loading branch information
splurf committed Jan 16, 2024
1 parent 058e442 commit 0c79c57
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down Expand Up @@ -117,12 +115,12 @@ impl TryInto<Body> 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,
})
}
}
Expand Down

0 comments on commit 0c79c57

Please sign in to comment.