Need to do loop elements.

This commit is contained in:
Tom Alexander
2020-05-09 14:10:38 -04:00
parent fcb2f3fc4d
commit 2712126b3c
4 changed files with 25 additions and 39 deletions

View File

@@ -58,33 +58,23 @@ impl error::Error for RenderError<'_> {
}
}
impl fmt::Display for WalkError<'_> {
impl fmt::Display for WalkError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
WalkError::CantWalk { segment, elem } => {
write!(f, "Tried to walk to {} from {:?}", segment, elem)
}
WalkError::NotFound { path, breadcrumbs } => {
write!(f, "Could not find {:?} in {:?}", path, breadcrumbs)
}
WalkError::CantWalk => write!(f, "Failed to walk"),
}
}
}
impl fmt::Debug for WalkError<'_> {
impl fmt::Debug for WalkError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
WalkError::CantWalk { segment, elem } => {
write!(f, "Tried to walk to {} from {:?}", segment, elem)
}
WalkError::NotFound { path, breadcrumbs } => {
write!(f, "Could not find {:?} in {:?}", path, breadcrumbs)
}
WalkError::CantWalk => write!(f, "Failed to walk"),
}
}
}
impl error::Error for WalkError<'_> {
impl error::Error for WalkError {
fn source(&self) -> Option<&(dyn error::Error + 'static)> {
None
}