From ec34b80b49e30caed4025c8ffcf3bca4525acea7 Mon Sep 17 00:00:00 2001 From: Ionut Mihalcea Date: Tue, 15 Feb 2022 12:12:39 +0000 Subject: [PATCH] Use default constructor for `Date::new_empty` Signed-off-by: Ionut Mihalcea --- cryptoki/src/types.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/cryptoki/src/types.rs b/cryptoki/src/types.rs index 9f864284..49b816c5 100644 --- a/cryptoki/src/types.rs +++ b/cryptoki/src/types.rs @@ -9,7 +9,7 @@ use std::convert::TryInto; use std::fmt::Formatter; use std::ops::Deref; -#[derive(Debug, Copy, Clone)] +#[derive(Debug, Copy, Clone, Default)] #[repr(transparent)] /// Value that represents a date pub struct Date { @@ -59,12 +59,7 @@ impl Date { /// This represents the default value of the attribute (on /// newer implementations of `Cryptoki`). pub fn new_empty() -> Self { - let date = CK_DATE { - year: Default::default(), - month: Default::default(), - day: Default::default(), - }; - Self { date } + Self::default() } /// Check if `Date` is empty