Remove unused 'RouteUriError::Segment' variant.

This commit is contained in:
Sergio Benitez 2021-03-04 02:49:29 -08:00
parent a3946377f7
commit 630f2c1105
1 changed files with 2 additions and 11 deletions

View File

@ -209,8 +209,6 @@ use crate::http::ext::IntoOwned;
/// Error returned by [`Route::map_base()`] on invalid URIs. /// Error returned by [`Route::map_base()`] on invalid URIs.
#[derive(Debug)] #[derive(Debug)]
pub enum RouteUriError { pub enum RouteUriError {
/// The base (mount point) or route path contains invalid segments.
Segment(String, String),
/// The route URI is not a valid URI. /// The route URI is not a valid URI.
Uri(uri::Error<'static>), Uri(uri::Error<'static>),
/// The base (mount point) contains dynamic segments. /// The base (mount point) contains dynamic segments.
@ -226,15 +224,8 @@ impl<'a> From<uri::Error<'a>> for RouteUriError {
impl fmt::Display for RouteUriError { impl fmt::Display for RouteUriError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self { match self {
RouteUriError::Segment(seg, err) => { RouteUriError::DynamicBase => write!(f, "Mount point contains dynamic parameters."),
write!(f, "Malformed segment '{}': {}", Paint::white(seg), err) RouteUriError::Uri(error) => write!(f, "Malformed URI: {}", error)
}
RouteUriError::DynamicBase => {
write!(f, "The mount point contains dynamic parameters.")
}
RouteUriError::Uri(error) => {
write!(f, "Malformed URI: {}", error)
}
} }
} }
} }