Micro: Accessors can reveal internal representation

As a library maintainer, it’s common to receive requests from users to add a “simple accessor”. The data is right there . But that accessor can end up revealing internal representation details that you can no longer change. This is one reason why it could be a better practice to return an impl Iterator instead of &[T] . The latter freezes you in place to always storing the data in consecutive…