Skip to content
Discussion options

You must be logged in to vote

That would require poking many maintainers - probably tens of them

Perhaps, but assuming that each maintainer has 2+ users, the total impact would be much greater for them to perform the change.

or implement many wrappers

Maybe? There's not really anything special about the wrapper I showed; you could likely make it generic and use it in a number of places, assuming that all the other errors also implement Debug as the common thing.

struct DebugWrap<E>(E);

impl<E: fmt::Debug> core::error::Error for DebugWrap<E> {}

impl<E: fmt::Debug> fmt::Debug for DebugWrap<E> {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        self.0.fmt(f)
    }
}

impl<E: fmt::Debug> fmt::Di…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@yanshay
Comment options

@shepmaster
Comment options

Answer selected by yanshay
@yanshay
Comment options

Comment options

You must be logged in to vote
1 reply
@shepmaster
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants