cafebabe icon indicating copy to clipboard operation
cafebabe copied to clipboard

[Suggestion] Derive more traits?

Open edgarogh opened this issue 2 years ago • 2 comments

A lot of structs would benefit from deriving more traits than just Debug. I'm stuck having to copy-paste structures of the library because I can't Clone them with the current design. This checklist provides a few tips for good crate interoperability, and more specifically a list of traits you may consider eagerly deriving/implementing on every struct where it makes sense.

I can submit a PR if you're interested.

edgarogh avatar Feb 17 '23 16:02 edgarogh

Yeah, fair point. I usually add the derives as I discover I need them. If you submit a PR to add more derived traits where they make sense, that would be very welcome. (My definition of "where they make sense" might differ from yours, but I can prune away derives from your PR if I feel they don't make sense).

staktrace avatar Feb 17 '23 19:02 staktrace

I'd too would love to see Clone added to additional structs/enums – in particular Opcode at the moment.

barereef avatar Nov 04 '23 00:11 barereef

https://github.com/staktrace/cafebabe/pull/38 and other recent PRs add more traits. Marking this resolved. Feel free to submit PRs for additional traits as needed.

staktrace avatar Aug 02 '24 12:08 staktrace