Fix clippy::transmute_ptr_to_ptr

This commit is contained in:
Zhiming Wang
2020-07-26 01:01:32 +08:00
parent c9c6031a53
commit e947bc5606
3 changed files with 7 additions and 13 deletions

View File

@ -260,7 +260,7 @@ impl Video {
unsafe {
slice::from_raw_parts(
mem::transmute((*self.as_ptr()).data[index]),
(*self.as_ptr()).data[index] as *const T,
self.stride(index) * self.plane_height(index) as usize / mem::size_of::<T>(),
)
}
@ -278,7 +278,7 @@ impl Video {
unsafe {
slice::from_raw_parts_mut(
mem::transmute((*self.as_mut_ptr()).data[index]),
(*self.as_mut_ptr()).data[index] as *mut T,
self.stride(index) * self.plane_height(index) as usize / mem::size_of::<T>(),
)
}