Hi!
I was wondering if there was any situation where it would be required to make a field or method public inside of a private struct? I've been asking about this to some colleagues and we couldn't get any relevant example.
Take the following example as an illustration:
struct MyStruct {
pub field: i32, // this `pub` is useless?
}
impl MyStruct {
pub fn drop(self) {} // this `pub` is useless?
}
If pub
is never actualy useful inside of a private type I would gladly implement a lint for clippy or even rustc (which could be desired as having pub
marked on some methods may lead to think that over methods are hidden at some level).