Skip to content

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).

@nepalez nepalez force-pushed the error_kind branch 2 times, most recently from cd9f19a to 97aa2cc Compare August 6, 2023 16:54
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