Skip to content

Commit d25795e

Browse files
committed
errors: Derive Error (and Display) for AppErrToStdErr
1 parent 0ab67f1 commit d25795e

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/util/errors.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -253,17 +253,10 @@ pub fn internal<S: ToString + ?Sized>(error: &S) -> Box<dyn AppError> {
253253
})
254254
}
255255

256-
#[derive(Debug)]
256+
#[derive(Debug, thiserror::Error)]
257+
#[error("{0}")]
257258
struct AppErrToStdErr(pub Box<dyn AppError>);
258259

259-
impl Error for AppErrToStdErr {}
260-
261-
impl fmt::Display for AppErrToStdErr {
262-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
263-
self.0.fmt(f)
264-
}
265-
}
266-
267260
pub(crate) fn std_error(e: Box<dyn AppError>) -> Box<dyn Error + Send> {
268261
Box::new(AppErrToStdErr(e))
269262
}

0 commit comments

Comments
 (0)