reformat file
This commit is contained in:
parent
6cba2f93e1
commit
fc397672f5
|
@ -1,5 +1,4 @@
|
||||||
pub mod schemas {
|
pub mod schemas {
|
||||||
use std::error::Error;
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
|
@ -82,8 +81,7 @@ pub mod schemas {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
let regex =
|
let regex = Regex::new(r"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$").unwrap();
|
||||||
regex::Regex::new(r"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$").unwrap();
|
|
||||||
if email.clone().is_some() && !regex.is_match(email.clone().unwrap().as_str()) {
|
if email.clone().is_some() && !regex.is_match(email.clone().unwrap().as_str()) {
|
||||||
return Err(RegisterSchemaError {
|
return Err(RegisterSchemaError {
|
||||||
message: "The provided email address is in an invalid format.".to_string(),
|
message: "The provided email address is in an invalid format.".to_string(),
|
||||||
|
|
Loading…
Reference in New Issue