Mutation slice from raw pointer

I want to get mutation slice from raw pointer. for immutable slice, I have found a way

let slice = unsafe { std::slice::from_raw_parts(some_pointer, count_of_items) };

but I want mutable slice

&mut[u8]

https://doc.rust-lang.org/std/slice/fn.from_raw_parts_mut.html

1 Like