rust/vec2d/src/lib.rs
branchtransitional_engine
changeset 15930 f39f0f614dbf
parent 14723 29dbe9ce8b7d
child 15942 6e22f4390b7e
equal deleted inserted replaced
15929:128ace913837 15930:f39f0f614dbf
   100     pub unsafe fn as_bytes(&self) -> &[u8] {
   100     pub unsafe fn as_bytes(&self) -> &[u8] {
   101         use std::{
   101         use std::{
   102             slice,
   102             slice,
   103             mem
   103             mem
   104         };
   104         };
   105         
   105 
   106         slice::from_raw_parts(
   106         slice::from_raw_parts(
   107             self.data.as_ptr() as *const u8,
   107             self.data.as_ptr() as *const u8,
   108             self.data.len() * mem::size_of::<T>(),
   108             self.data.len() * mem::size_of::<T>(),
   109         )
   109         )
   110     }
   110     }