Skip to content

Commit

Permalink
[rs] Implement AsRef for BufferView
Browse files Browse the repository at this point in the history
Remove AsRef<[u8]> for BufferViewMut.
  • Loading branch information
de-vri-es committed Sep 21, 2020
1 parent 47c05b3 commit 81df9fb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions wgpu/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1658,6 +1658,18 @@ impl std::ops::DerefMut for BufferViewMut<'_> {
}
}

impl AsRef<[u8]> for BufferView<'_> {
fn as_ref(&self) -> &[u8] {
self.data
}
}

impl AsMut<[u8]> for BufferViewMut<'_> {
fn as_mut(&mut self) -> &mut [u8] {
self.data
}
}

impl Drop for BufferView<'_> {
fn drop(&mut self) {
self.slice
Expand Down

0 comments on commit 81df9fb

Please sign in to comment.