Closed
Description
Now that you can't really put pub
at the top-level of things like impl/extern/trait, you don't need the priv
keyword to control method visibility of various items because they're all private by default.
pros:
- I think that this would really simplify public/private because there's one and only one rule: private by default, public if you flag it
- one less keyword!
difficulties:
- Right now this is the only way to make struct fields private. I personally believe that private-by-default for struct fields isn't that bad of an idea, and if this were the only thing blocking removing
priv
I'd vote to remove it.
cons:
- Enum variants can currently be tagged as
priv
, and if we removed priv there would be no way to make half the enum variants public and half private. In theorypub enum
makes everything public and you could otherwise writepub
on each variant, but the type name would still then have to be public and if it didn't havepub
in front of it it wouldn't really make sense - Private-by-default for structs is kind of annoying sometimes.
What do others think about this?