3 ms·
We have the following validation: let form_email: Option::<String> = /* ... */; match form_email { Some(email) if !email.is_empty() => {
by WirelessGigabit 3y ago
We have the following validation:
let form_email: Option::<String> = /* ... */;
match form_email {
Some(email) if !email.is_empty() => {
// ... send email with validation link
},
_ => {
// report missing email
}
}
If you (can) click the validation link it's a valid email. If not... it's invalid. Saves me the trouble of debugging all the regexes.