validators 0.26.0

This library is designed for validating and modeling user input. The crate includes models, functions, traits, errors, and other dependencies.
use core::fmt::{self, Display, Formatter};

use crate::url;

/// Error from the `url` validator.
#[derive(Debug, Clone)]
pub struct UrlError(pub url::ParseError);

impl From<url::ParseError> for UrlError {
    #[inline]
    fn from(error: url::ParseError) -> Self {
        Self(error)
    }
}

impl Display for UrlError {
    #[inline]
    fn fmt(&self, f: &mut Formatter) -> Result<(), fmt::Error> {
        Display::fmt(&self.0, f)
    }
}

impl core::error::Error for UrlError {}