From adb12aa51ab055f831e429baacbb0c919c3f942e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?VIAL=20S=C3=A9bastien?= Date: Sat, 25 Nov 2023 22:34:00 +0100 Subject: [PATCH] feat(password): clone, partialeq, eq --- Cargo.toml | 2 +- src/lib.rs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4cea779..5d754fe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ documentation = "https://docs.rs/tag_password" homepage = "https://devs.transitions.ag/" repository = "https://github.com/TransitionsAg/tag_password" readme = "README.md" -version = "0.1.3-pre3" +version = "0.1.3" edition = "2021" [dependencies] diff --git a/src/lib.rs b/src/lib.rs index 417044a..0b27aec 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -62,6 +62,7 @@ use std::{ /// It serves as a zero-sized type without any fields, consuming no memory at runtime. /// When paired with `PhantomData`, it enables compile-time checks to distinguish /// between hashed and non-hashed password types. +#[derive(Clone, PartialEq, Eq)] pub struct Hashed; /// Marker type indicating a plain text password. @@ -71,6 +72,7 @@ pub struct Hashed; /// zero-sized type without any fields, consuming no memory at runtime. /// When paired with `PhantomData`, it enables compile-time checks to differentiate /// between plain text and hashed password types. +#[derive(Clone, PartialEq, Eq)] pub struct Plain; /// Represents password data that can be hashed and verified. @@ -78,7 +80,7 @@ pub struct Plain; /// This struct encapsulates password data and supports hashing with the `hash` function, /// which can be enabled with the `argon2` feature. It also provides verification /// functionality via the `verify` function. -#[derive(Clone)] +#[derive(Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct Password(PhantomData, String);