Skip to content

Commit

Permalink
Use default constructor for Date::new_empty
Browse files Browse the repository at this point in the history
Signed-off-by: Ionut Mihalcea <[email protected]>
  • Loading branch information
ionut-arm committed Mar 2, 2022
1 parent 3a21c37 commit ec34b80
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions cryptoki/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ec34b80

Please sign in to comment.