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

Derive Debug for Cue, Track, CuePoint, CodecParameters, VerificationCheck #90

Merged
merged 1 commit into from
Dec 30, 2021

Conversation

antifuchs
Copy link
Contributor

I'm writing software where having these data types be debug-printable would be helpful. I see some other types got Debug impls recently, so I hope this can make it in, too!

…heck

This allows debug-printing the tracks and cue sheets on streams.
@pdeljanov pdeljanov merged commit af14e70 into pdeljanov:master Dec 30, 2021
@pdeljanov
Copy link
Owner

Hey @antifuchs,

Thanks for this. Yeah, I see no problem with adding these.

According to the Rust API Guidelines we should be eagerly deriving these traits for most types. Not deriving them seems to be a mistake.

@antifuchs antifuchs deleted the debug-trait branch December 30, 2021 21:12
@antifuchs
Copy link
Contributor Author

Brilliant, thank you! You're right that there are a few more that might be missing. I might be able to get the remainder decorated, too.

@pdeljanov
Copy link
Owner

Sure, if you have time and want to go over the public types to make sure they're decorated, that'd be great! No worries if you can't though.

I noticed that std does implement Debug via. a custom implementation for "class-like" structs such as BufReader, but it's kinda subjective regarding what should be printed so I don't think we should do that. I think if you just decorated public enums and the simple "data-only" structs we should be fine.

Thanks!

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.

2 participants