From 35b308d41e8bf4357bb8d1da1605e4ba97fbf086 Mon Sep 17 00:00:00 2001 From: Sean Burke Date: Thu, 28 Nov 2024 03:08:14 -0800 Subject: [PATCH] Derive additional useful traits for ResponseCode (#35) `ResponseCode` is no longer `String`-based, so we can use `Copy`. It might also make sense to provide a default value of `NoError` for cases where it might be the contents of an `Option`. --- src/types/common.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/types/common.rs b/src/types/common.rs index 9f0154b..4a56f94 100644 --- a/src/types/common.rs +++ b/src/types/common.rs @@ -253,9 +253,11 @@ pub enum ResponseClass { /// any. /// /// See -#[derive(Clone, Debug, Deserialize, PartialEq)] +#[derive(Clone, Copy, Debug, Default, Deserialize, PartialEq)] pub enum ResponseCode { + #[default] NoError, + ErrorAccessDenied, ErrorAccessModeSpecified, ErrorAccountDisabled,