hecatia-elegua / bilge

Use bitsized types as if they were a feature of rust.
Apache License 2.0
171 stars 17 forks source link

Figure out visibility #12

Open hecatia-elegua opened 1 year ago

hecatia-elegua commented 1 year ago

Currently, new is always pub and the field visibility is getting applied to both getters and setters. This doesn't have to do with read-/write-only fields, since you might still want to access private get/set in an impl:

impl Bitfield {
  fn z_movement(&self) -> i8 {
    self.z_first() | (self.z_others() << 1)
  }
}

If we want to fit rust (pub-only, no private), this is a breaking change, or we can maybe use a feature gate.

Also, look out for dead_code warnings in user code (users should be able to suppress those).