validators/errors/
regex.rs

1use core::fmt::{self, Display, Formatter};
2#[cfg(feature = "std")]
3use std::error::Error;
4
5/// Error from the `regex` validator.
6#[derive(Debug, Clone)]
7pub struct RegexError;
8
9impl Display for RegexError {
10    #[inline]
11    fn fmt(&self, f: &mut Formatter) -> Result<(), fmt::Error> {
12        f.write_str("invalid format")
13    }
14}
15
16#[cfg(feature = "std")]
17impl Error for RegexError {}