Include regex within validator
This commit is contained in:
parent
988dcb7d21
commit
2d8b22ce65
|
@ -9,7 +9,7 @@ pub fn regex<T: AsRef<str> + InputType>(
|
|||
if let Ok(true) = Regex::new(regex).map(|re| re.is_match(value.as_ref())) {
|
||||
Ok(())
|
||||
} else {
|
||||
Err("value doesn't match expected format".into())
|
||||
Err(format_args!("value doesn't match expected format: {}", regex).into())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user