diff options
author | Tyler Murphy <tylermurphy534@gmail.com> | 2023-03-01 01:19:16 -0500 |
---|---|---|
committer | Tyler Murphy <tylermurphy534@gmail.com> | 2023-03-01 01:19:16 -0500 |
commit | 6c62c26d0df243b00914de22cb8d30a8ba3e3eb4 (patch) | |
tree | b54f1285f3491f9821718686ed3982cdac19d57e /packet/src/query.rs | |
parent | inital working dns (diff) | |
download | wrapper-6c62c26d0df243b00914de22cb8d30a8ba3e3eb4.tar.gz wrapper-6c62c26d0df243b00914de22cb8d30a8ba3e3eb4.tar.bz2 wrapper-6c62c26d0df243b00914de22cb8d30a8ba3e3eb4.zip |
clippy my beloved
Diffstat (limited to 'packet/src/query.rs')
-rw-r--r-- | packet/src/query.rs | 26 |
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 |