mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 01:27:31 +08:00
enhancement(common_utils): impl from for email newtype (#1074)
This commit is contained in:
@ -122,6 +122,12 @@ where
|
||||
#[diesel(sql_type = diesel::sql_types::Text)]
|
||||
pub struct Email(Secret<String, EmailStrategy>);
|
||||
|
||||
impl From<Secret<String, EmailStrategy>> for Email {
|
||||
fn from(value: Secret<String, EmailStrategy>) -> Self {
|
||||
Self(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl ops::Deref for Email {
|
||||
type Target = Secret<String, EmailStrategy>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user