Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
574: Implement AsRef for BufferView r=kvark a=de-vri-es This PR implements `AsRef` and `AsMut` in addition to `Deref` and `DerefMut` for `BufferView` and `BufferViewMut`. This allows the buffer views to be used directly by generic code that wants an `AsRef<[u8]>`. It's also subjectively a small win when you want to pass the views to non-generic code. I find `buffer.as_ref()` clearer than `&*buffer`. That also goes for `buffer.deref()`, but `Deref` is not in the prelude. Co-authored-by: Maarten de Vries <[email protected]>
- Loading branch information