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

swarm-derive/: Derive Debug for generated OutEvent #2821

Merged
merged 4 commits into from Aug 17, 2022

Conversation

mxinden
Copy link
Member

@mxinden mxinden commented Aug 16, 2022

Description

When generating an OutEvent enum definition for a user, derive Debug
for that enum.

Why not derive Clone, PartialEq and Eq for the generated enum
definition?

While I think it is fine to require all sub-OutEvents to implement
Debug, I don't think the same applies to traits like Clone. I
suggest users that need Clone to define their own OutEvent.

Links to any relevant issues

Depends on #2819.

See also discussion in #2751 (comment).

Open Questions

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

When generating an `OutEvent` `enum` definition for a user, derive `Debug`
for that `enum`.

Why not derive `Clone`, `PartialEq` and `Eq` for the generated `enum`
definition?

While I think it is fine to require all sub-`OutEvent`s to implement
`Debug`, I don't think the same applies to traits like `Clone`. I
suggest users that need `Clone` to define their own `OutEvent`.
@mxinden mxinden merged commit a2738fd into libp2p:master Aug 17, 2022
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.

None yet

2 participants