You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current RFC bars mapping public trait members to private fields. @petrochenkov questioned this, and I think rightly so. Basically, there is no major difference between:
impl Foo for Bar {
f = self.g
}
and
impl Foo for Bar {
fn f(&self) -> &G { &self.g }
}
The text was updated successfully, but these errors were encountered:
Allowing private fields is very useful for use in the implementation of provided methods, but it could lead to unintentionally exposing private fields to users, potentially breaking invariants.
The current RFC bars mapping public trait members to private fields. @petrochenkov questioned this, and I think rightly so. Basically, there is no major difference between:
and
The text was updated successfully, but these errors were encountered: