Skip to content

Commit

Permalink
change fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
joalopez1206 committed Oct 1, 2024
1 parent fd822de commit 298dd0f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 36 deletions.
17 changes: 9 additions & 8 deletions src/message/rclass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,14 @@ impl Default for Rclass {

impl fmt::Display for Rclass {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", match *self {
Rclass::IN => "IN",
Rclass::CS => "CS",
Rclass::CH => "CH",
Rclass::HS => "HS",
Rclass::ANY => "ANY",
Rclass::UNKNOWN(_) => "UNKNOWN",
})
let result = match *self {
Rclass::IN => "IN".to_string(),
Rclass::CS => "CS".to_string(),
Rclass::CH => "CH".to_string(),
Rclass::HS => "HS".to_string(),
Rclass::ANY => "ANY".to_string(),
Rclass::UNKNOWN(x) => x.to_string(),
};
write!(f, "{}", result)
}
}
57 changes: 29 additions & 28 deletions src/message/rrtype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,33 +131,34 @@ impl Default for Rrtype {
}
impl fmt::Display for Rrtype {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", match *self {
Rrtype::A => "A",
Rrtype::NS => "NS",
Rrtype::CNAME => "CNAME",
Rrtype::SOA => "SOA",
Rrtype::PTR => "PTR",
Rrtype::HINFO => "HINFO",
Rrtype::MINFO => "MINFO",
Rrtype::WKS => "WKS",
Rrtype::MX => "MX",
Rrtype::TXT => "TXT",
Rrtype::AAAA => "AAAA",
Rrtype::SRV => "SRV",
Rrtype::DNAME => "DNAME",
Rrtype::OPT => "OPT",
Rrtype::DS => "DS",
Rrtype::RRSIG => "RRSIG",
Rrtype::NSEC => "NSEC",
Rrtype::DNSKEY => "DNSKEY",
Rrtype::NSEC3 => "NSEC3",
Rrtype::NSEC3PARAM => "NSEC3PARAM",
Rrtype::TSIG => "TSIG",
Rrtype::AXFR => "AXFR",
Rrtype::MAILB => "MAILB",
Rrtype::MAILA => "MAILA",
Rrtype::ANY => "ANY",
Rrtype::UNKNOWN(_) => "UNKNOWN",
})
let result = match *self {
Rrtype::A => "A".to_string(),
Rrtype::NS => "NS".to_string(),
Rrtype::CNAME => "CNAME".to_string(),
Rrtype::SOA => "SOA".to_string(),
Rrtype::PTR => "PTR".to_string(),
Rrtype::HINFO => "HINFO".to_string(),
Rrtype::MINFO => "MINFO".to_string(),
Rrtype::WKS => "WKS".to_string(),
Rrtype::MX => "MX".to_string(),
Rrtype::TXT => "TXT".to_string(),
Rrtype::AAAA => "AAAA".to_string(),
Rrtype::SRV => "SRV".to_string(),
Rrtype::DNAME => "DNAME".to_string(),
Rrtype::OPT => "OPT".to_string(),
Rrtype::DS => "DS".to_string(),
Rrtype::RRSIG => "RRSIG".to_string(),
Rrtype::NSEC => "NSEC".to_string(),
Rrtype::DNSKEY => "DNSKEY".to_string(),
Rrtype::NSEC3 => "NSEC3".to_string(),
Rrtype::NSEC3PARAM => "NSEC3PARAM".to_string(),
Rrtype::TSIG => "TSIG".to_string(),
Rrtype::AXFR => "AXFR".to_string(),
Rrtype::MAILB => "MAILB".to_string(),
Rrtype::MAILA => "MAILA".to_string(),
Rrtype::ANY => "ANY".to_string(),
Rrtype::UNKNOWN(x) => x.to_string(),
};
write!(f, "{}", result)
}
}

0 comments on commit 298dd0f

Please sign in to comment.