dirbaio[m]: > <@dirbaio:matrix.org> ## A- How much better is &self for drivers? > > - In practice it doesn't matter much: If we do `&mut self`, any driver that wants to share a pin can do it just fine with `RefCell` anyway. > - Therefore the question becomes "how often does `&self` allow removing a RefCell in a driver?" > - The answer so far seems to be "never". > > - We haven't found any driver so far. > - It seems VERY rare that a driver needs to share ONLY an InputPin. For example the [keypad driver](https://github.com/rust-embedded/embedded-hal/pull/547#issuecomment-1876182298) needs sharing both InputPin and OutputPin so it needs a RefCell anyway. > > ## B- How much better is &mut self for impls? > > - In practice it doesn't matter much: If we do `&self`, any impl that wants mutable state can do it just fine with `RefCell` anyway. > - Therefore the question becomes "how often does `&mut self` allow removing a RefCell in an impl?" > - The answer seems to be "sometimes" > > - We DO have examples of impls where this removes a RefCell: https://github.com/rust-embedded/embedded-hal/issues/546 > > Therefore B is stronger than A in my eyes. That removes a `Cell`, not a `RefCell`