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

impl<T> Format for PhantomData<T> #327

Merged
merged 2 commits into from
Jan 11, 2021
Merged

Conversation

mattico
Copy link
Contributor

@mattico mattico commented Jan 6, 2021

I needed this to be able to #[derive(Format)] on a few structs.

Copy link
Member

@japaric japaric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! This looks good. Could you please extend the snapshot test in firmware/qemu/src/bin/log.rs to test that something like S { x: PhantomData<u8>, y: u8 } is correctly formatted by {=[?]}? I'd like to confirm that the tag is omitted when you format a slice of PhantomDatas and the whole thing is properly decoded.

src/impls.rs Outdated Show resolved Hide resolved
Copy link
Member

@japaric japaric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@japaric
Copy link
Member

japaric commented Jan 11, 2021

bors r+

@bors
Copy link
Contributor

bors bot commented Jan 11, 2021

Build succeeded:

@bors bors bot merged commit ca42c7d into knurling-rs:main Jan 11, 2021
@mattico mattico deleted the phantomdata-fmt branch January 11, 2021 17:00
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