Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop requiring error kinds to impl Display #1066

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nepalez
Copy link
Contributor

@nepalez nepalez commented Jul 31, 2023

All kinds of error::Error<Kind> now implement the Display trait, and the Display for the Error<Kind> itself is inherited from its Kind.

The binding between the kind and Display is not necessary though.

In this commit I dropped the restriction of error kinds by Display, and only implemented the trait for errors with displayable kinds. As a result, the developer got 2 options:

  • either to implement the Display for the kind (preferred),
  • or implement it for the error only (but not for the kind) (edge case).

All kinds of `error::Error` now implements the `Display` trait,
and the `Display` for the `Error` itself is inherited.

The binding between the kind and `Display` is not necessary though.

In this commit I dropped the restriction of error kinds by `Display`,
and only implemented the trait for errors with displayable kinds.
As a result, the developer got 2 options:

- either to implement the `Display` for the kind (preferred),
- or implement it for the error only (but not for the kind) (edge case).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant