acme: derive Default for Status

Fixes the clippy warning:

warning: this `impl` can be derived
  --> proxmox-acme/src/order.rs:36:1
   |
36 | / impl Default for Status {
37 | |     fn default() -> Self {
38 | |         Status::New
39 | |     }
40 | | }
   | |_^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
   = note: `#[warn(clippy::derivable_impls)]` on by default
   = help: remove the manual implementation...
help: ...and instead derive it...
   |
12 + #[derive(Default)]
13 | pub enum Status {
   |
help: ...and mark the default variant
   |
15 ~     #[default]
16 ~     New,
   |

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
This commit is contained in:
Maximiliano Sandoval 2024-06-26 14:43:43 +02:00 committed by Wolfgang Bumiller
parent baccbda477
commit a4b57d6c3c

View File

@ -9,9 +9,11 @@ use crate::Error;
/// Status of an [`Order`]. /// Status of an [`Order`].
#[derive(Clone, Copy, Debug, Eq, PartialEq, Deserialize, Serialize)] #[derive(Clone, Copy, Debug, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "lowercase")] #[serde(rename_all = "lowercase")]
#[derive(Default)]
pub enum Status { pub enum Status {
/// Invalid, used as a place holder for when sending objects as contrary to account creation, /// Invalid, used as a place holder for when sending objects as contrary to account creation,
/// the Acme RFC does not require the server to ignore unknown parts of the `Order` object. /// the Acme RFC does not require the server to ignore unknown parts of the `Order` object.
#[default]
New, New,
/// Authorization failed and it is now invalid. /// Authorization failed and it is now invalid.
@ -33,12 +35,6 @@ pub enum Status {
Valid, Valid,
} }
impl Default for Status {
fn default() -> Self {
Status::New
}
}
impl Status { impl Status {
/// Serde helper /// Serde helper
fn is_new(&self) -> bool { fn is_new(&self) -> bool {