Skip to content

Implements public-fields flag#22

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

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

Conversation

@vjau
Copy link
Contributor

@vjau vjau commented Oct 21, 2025

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
Copy link
Owner

jayy-lmao commented Oct 21, 2025

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
Copy link
Contributor Author

vjau commented Oct 21, 2025

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
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