diff options
| author | benj <benj@rse8.com> | 2022-12-21 16:23:12 -0800 |
|---|---|---|
| committer | benj <benj@rse8.com> | 2022-12-21 16:23:12 -0800 |
| commit | de6339da72af1d61ca5908b780977e2b037ce014 (patch) | |
| tree | 96add0e538cef4b6b5912492c28a3d5e9ed25cbe /crates/secd/src | |
| parent | a734a77520a3f9f0061e44c4fac6c42801730496 (diff) | |
| download | secdiam-de6339da72af1d61ca5908b780977e2b037ce014.tar secdiam-de6339da72af1d61ca5908b780977e2b037ce014.tar.gz secdiam-de6339da72af1d61ca5908b780977e2b037ce014.tar.bz2 secdiam-de6339da72af1d61ca5908b780977e2b037ce014.tar.lz secdiam-de6339da72af1d61ca5908b780977e2b037ce014.tar.xz secdiam-de6339da72af1d61ca5908b780977e2b037ce014.tar.zst secdiam-de6339da72af1d61ca5908b780977e2b037ce014.zip | |
some cleanup
Diffstat (limited to '')
| -rw-r--r-- | crates/secd/src/command/authn.rs | 15 |
1 files changed, 5 insertions, 10 deletions
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<ValidationRequestId, SecdError> { 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 { |
