Impl Display for StoreLinkConsistencyErrorCustomData
This commit is contained in:
parent
13b24cb397
commit
0155fea4c1
1 changed files with 19 additions and 0 deletions
|
@ -605,6 +605,23 @@ pub mod store_check {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Display for StoreLinkConsistencyErrorCustomData {
|
impl Display for StoreLinkConsistencyErrorCustomData {
|
||||||
|
|
||||||
|
fn fmt(&self, fmt: &mut Formatter) -> Result<(), FmtError> {
|
||||||
|
use self::StoreLinkConsistencyErrorCustomData as SLCECD;
|
||||||
|
match self {
|
||||||
|
&SLCECD::DeadLink { ref target } => {
|
||||||
|
try!(write!(fmt, "Dead Link to '{}'", target))
|
||||||
|
},
|
||||||
|
|
||||||
|
&SLCECD::OneDirectionalLink { ref source, ref target } => {
|
||||||
|
try!(write!(fmt,
|
||||||
|
"Link from '{}' to '{}' does exist, but not other way round",
|
||||||
|
source, target))
|
||||||
|
}
|
||||||
|
};
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
generate_custom_error_types!(
|
generate_custom_error_types!(
|
||||||
|
@ -631,6 +648,8 @@ pub mod store_check {
|
||||||
pub type Result<T> = RResult<T, SLCE>;
|
pub type Result<T> = RResult<T, SLCE>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
use self::result::Result;
|
||||||
|
|
||||||
pub trait StoreLinkConsistentExt {
|
pub trait StoreLinkConsistentExt {
|
||||||
fn check_link_consistency(&self) -> Result<()>;
|
fn check_link_consistency(&self) -> Result<()>;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue