Get rid of Error::description()

This commit is contained in:
Adrian Heine 2020-08-06 17:38:27 +02:00
parent 7f5daa3c0e
commit d3236903fc
2 changed files with 7 additions and 19 deletions

View file

@ -22,12 +22,6 @@ pub enum SymbolRunError {
}
impl Error for SymbolRunError {
fn description(&self) -> &str {
match self {
Self::Symbol(_) => "Symbol execution error",
Self::ExecuteDidNotReach(_) => "Target not reached after executing symbol",
}
}
fn cause(&self) -> Option<&dyn Error> {
match self {
Self::Symbol(ref e) => Some(&**e),
@ -40,7 +34,7 @@ impl fmt::Display for SymbolRunError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::Symbol(ref e) => write!(f, "{}", e),
Self::ExecuteDidNotReach(_) => write!(f, "{}", self.description()),
Self::ExecuteDidNotReach(_) => write!(f, "Target not reached after executing symbol"),
}
}
}