From de6339da72af1d61ca5908b780977e2b037ce014 Mon Sep 17 00:00:00 2001 From: benj Date: Wed, 21 Dec 2022 16:23:12 -0800 Subject: some cleanup --- crates/secd/src/command/authn.rs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'crates/secd/src/command/authn.rs') diff --git a/crates/secd/src/command/authn.rs b/crates/secd/src/command/authn.rs index b254614..9c2babe 100644 --- a/crates/secd/src/command/authn.rs +++ b/crates/secd/src/command/authn.rs @@ -61,19 +61,14 @@ impl Secd { /// Generate a request to validate the provided email. pub async fn create_validation_request_email( &self, - email: Option<&str>, + email: &str, ) -> Result { let now = OffsetDateTime::now_utc(); - let email = match email { - Some(ea) => { - if EmailAddress::is_valid(ea) { - ea - } else { - return Err(SecdError::InvalidEmailAddress); - } - } - None => return Err(SecdError::InvalidEmailAddress), + let email = if EmailAddress::is_valid(email) { + email + } else { + return Err(SecdError::InvalidEmailAddress); }; let mut ev = EmailValidation { -- cgit v1.2.3