diff options
author | metamuffin <metamuffin@disroot.org> | 2024-07-06 01:19:02 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-07-06 01:19:02 +0200 |
commit | 5dd0fafce20ed37fdc97dc96539391ebdebffaff (patch) | |
tree | ad93b9e8d0e9c9c7dbe5a858902c2ba0114a47cf /src/encoding/status.rs | |
parent | a4c52bedef04cfb927f3d7809680fed0425a5125 (diff) | |
download | sip-rs-5dd0fafce20ed37fdc97dc96539391ebdebffaff.tar sip-rs-5dd0fafce20ed37fdc97dc96539391ebdebffaff.tar.bz2 sip-rs-5dd0fafce20ed37fdc97dc96539391ebdebffaff.tar.zst |
generalize to support requests. untested
Diffstat (limited to 'src/encoding/status.rs')
-rw-r--r-- | src/encoding/status.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/encoding/status.rs b/src/encoding/status.rs index f06110d..9fe03d7 100644 --- a/src/encoding/status.rs +++ b/src/encoding/status.rs @@ -1,7 +1,6 @@ - macro_rules! status_enum { ($v:vis enum $name:ident { $($variant:ident = $value:literal),*, }) => { - #[derive(Debug)] + #[derive(Debug, Clone)] $v enum $name { $($variant),*, Other(u16) } impl $name { pub fn from_code(c: u16) -> Self { match c { $($value => Self::$variant),*, x => Self::Other(x) } } } impl $name { pub fn to_code(&self) -> u16 { match self { $(Self::$variant => $value),*, Self::Other(x) => *x } } } |