Skip to content

Commit

Permalink
Remove unused 'RouteUriError::Segment' variant.
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioBenitez committed Mar 4, 2021
1 parent a394637 commit 630f2c1
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions core/lib/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,6 @@ use crate::http::ext::IntoOwned;
/// Error returned by [`Route::map_base()`] on invalid URIs.
#[derive(Debug)]
pub enum RouteUriError {
/// The base (mount point) or route path contains invalid segments.
Segment(String, String),
/// The route URI is not a valid URI.
Uri(uri::Error<'static>),
/// The base (mount point) contains dynamic segments.
Expand All @@ -226,15 +224,8 @@ impl<'a> From<uri::Error<'a>> for RouteUriError {
impl fmt::Display for RouteUriError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
RouteUriError::Segment(seg, err) => {
write!(f, "Malformed segment '{}': {}", Paint::white(seg), err)
}
RouteUriError::DynamicBase => {
write!(f, "The mount point contains dynamic parameters.")
}
RouteUriError::Uri(error) => {
write!(f, "Malformed URI: {}", error)
}
RouteUriError::DynamicBase => write!(f, "Mount point contains dynamic parameters."),
RouteUriError::Uri(error) => write!(f, "Malformed URI: {}", error)
}
}
}

0 comments on commit 630f2c1

Please sign in to comment.