summaryrefslogtreecommitdiff
path: root/packet/src/query.rs
diff options
context:
space:
mode:
Diffstat (limited to 'packet/src/query.rs')
-rw-r--r--packet/src/query.rs26
1 files changed, 13 insertions, 13 deletions
diff --git a/packet/src/query.rs b/packet/src/query.rs
index ac993bd..8804d15 100644
--- a/packet/src/query.rs
+++ b/packet/src/query.rs
@@ -11,23 +11,23 @@ pub enum QueryType {
impl QueryType {
pub fn to_num(&self) -> u16 {
match *self {
- QueryType::UNKNOWN(x) => x,
- QueryType::A => 1,
- QueryType::NS => 2,
- QueryType::CNAME => 5,
- QueryType::MX => 15,
- QueryType::AAAA => 28,
+ Self::UNKNOWN(x) => x,
+ Self::A => 1,
+ Self::NS => 2,
+ Self::CNAME => 5,
+ Self::MX => 15,
+ Self::AAAA => 28,
}
}
- pub fn from_num(num: u16) -> QueryType {
+ pub fn from_num(num: u16) -> Self {
match num {
- 1 => QueryType::A,
- 2 => QueryType::NS,
- 5 => QueryType::CNAME,
- 15 => QueryType::MX,
- 28 => QueryType::AAAA,
- _ => QueryType::UNKNOWN(num),
+ 1 => Self::A,
+ 2 => Self::NS,
+ 5 => Self::CNAME,
+ 15 => Self::MX,
+ 28 => Self::AAAA,
+ _ => Self::UNKNOWN(num),
}
}
} \ No newline at end of file