diff options
Diffstat (limited to 'src/types.rs')
-rw-r--r-- | src/types.rs | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/types.rs b/src/types.rs index c27b288..aca74cf 100644 --- a/src/types.rs +++ b/src/types.rs @@ -1,4 +1,3 @@ -use crate::crypto::SecretBytes; use chrono::{DateTime, Utc}; use password_hash::{rand_core::OsRng, Output, SaltString}; use rand::RngCore; @@ -163,11 +162,8 @@ macro_rules! bytea_types { // bytea_types! { - #[derive(Clone, Debug, PartialEq, Eq)] - struct HawkKey(SecretBytes<32>) as hawk_key { - fn decode(v) -> _ { v.0.0.as_ref() } - fn encode(v) -> _ { SecretBytes(v) } - } + #[simple_array] + struct HawkKey([u8; 32]) as hawk_key; #[simple_array] struct SessionID([u8; 32]) as session_id; @@ -196,11 +192,8 @@ bytea_types! { #[simple_array] struct AvatarID([u8; 16]) as avatar_id; - #[derive(Clone, Debug, PartialEq, Eq)] - struct SecretKey(SecretBytes<32>) as secret_key { - fn decode(v) -> _ { v.0.0.as_ref() } - fn encode(v) -> _ { SecretBytes(v) } - } + #[simple_array] + struct SecretKey([u8; 32]) as secret_key; #[derive(Clone, Debug, PartialEq, Eq)] struct VerifyHash(Output) as verify_hash { |