Skip to content

Implements public-fields flag#22

Open
vjau wants to merge 2 commits into
jayy-lmao:mainfrom
vjau:public_fields
Open

Implements public-fields flag#22
vjau wants to merge 2 commits into
jayy-lmao:mainfrom
vjau:public_fields

Conversation

@vjau

@vjau vjau commented Oct 21, 2025

Copy link
Copy Markdown
Contributor

I like my pure data structs to have public fields.
AFAIK, your crate make them by default private and there is no way to change that.
So, i have implemented a -- public-fields flag that makes all structs fields prefixed with pub.
I have tried to respect your project structure, which is very clean, btw.
I hope you will like it.

@jayy-lmao

jayy-lmao commented Oct 21, 2025

Copy link
Copy Markdown
Owner

Thanks for this! I like how you've gone about this- but now that you mention it I do wonder if public fields is actually a sensible default? I imagine there are probably more people in your same situation.

How would you feel about that?

@vjau

vjau commented Oct 21, 2025

Copy link
Copy Markdown
Contributor Author

I am not sure, after some research it seems the two points of view exist in the community.
For me, clearly, i don't see the point of having private field if the struct has no "methods"

@jayy-lmao

Copy link
Copy Markdown
Owner

Happy for a public default then 👍

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