Skip to content

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

Merged
bors[bot] merged 2 commits intoknurling-rs:mainfrom
mattico:phantomdata-fmt
Jan 11, 2021
Merged

impl<T> Format for PhantomData<T>#327
bors[bot] merged 2 commits intoknurling-rs:mainfrom
mattico:phantomdata-fmt

Conversation

@mattico
Copy link
Copy Markdown
Contributor

@mattico mattico commented Jan 6, 2021

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

Copy link
Copy Markdown
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.

Comment thread src/impls.rs Outdated
Copy link
Copy Markdown
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
Copy Markdown
Member

japaric commented Jan 11, 2021

bors r+

@bors
Copy link
Copy Markdown
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