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 theory pub enum makes everything public and you could otherwise write pub on each variant, but the type name would still then have to be public and if it didn't have pub 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?
Now that you can't really put
pubat the top-level of things like impl/extern/trait, you don't need theprivkeyword to control method visibility of various items because they're all private by default.pros:
difficulties:
privI'd vote to remove it.cons:
priv, and if we removed priv there would be no way to make half the enum variants public and half private. In theorypub enummakes everything public and you could otherwise writepubon each variant, but the type name would still then have to be public and if it didn't havepubin front of it it wouldn't really make senseWhat do others think about this?