diff options
Diffstat (limited to 'packet/src/result.rs')
-rw-r--r-- | packet/src/result.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/packet/src/result.rs b/packet/src/result.rs index 66108b8..f33bd7d 100644 --- a/packet/src/result.rs +++ b/packet/src/result.rs @@ -9,14 +9,14 @@ pub enum ResultCode { } impl ResultCode { - pub fn from_num(num: u8) -> ResultCode { + pub fn from_num(num: u8) -> Self { match num { - 1 => ResultCode::FORMERR, - 2 => ResultCode::SERVFAIL, - 3 => ResultCode::NXDOMAIN, - 4 => ResultCode::NOTIMP, - 5 => ResultCode::REFUSED, - 0 | _ => ResultCode::NOERROR, + 1 => Self::FORMERR, + 2 => Self::SERVFAIL, + 3 => Self::NXDOMAIN, + 4 => Self::NOTIMP, + 5 => Self::REFUSED, + 0 | _ => Self::NOERROR, } } }
\ No newline at end of file |