File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ use std::{
99 io:: Seek ,
1010 path:: { Path , PathBuf } ,
1111} ;
12- use zerocopy:: { FromBytes , Immutable , IntoBytes , Ref } ;
12+ use zerocopy:: { FromBytes , Immutable , IntoBytes } ;
1313use Precision :: * ;
1414
1515pub fn create_rng ( ) -> impl rand:: Rng {
@@ -47,10 +47,10 @@ pub fn hash_hex_f32(data: &[f32]) -> String {
4747pub trait Castable : FromBytes + IntoBytes + Immutable { }
4848impl < T : FromBytes + IntoBytes + Immutable > Castable for T { }
4949pub fn from_bytes < T : Castable > ( bytes : & [ u8 ] ) -> Option < & [ T ] > {
50- Ref :: from_bytes ( bytes) . ok ( ) . map ( Ref :: into_ref )
50+ FromBytes :: ref_from_bytes ( bytes) . ok ( )
5151}
5252pub fn from_bytes_mut < T : Castable > ( bytes : & mut [ u8 ] ) -> Option < & mut [ T ] > {
53- Ref :: from_bytes ( bytes) . ok ( ) . map ( Ref :: into_mut )
53+ FromBytes :: mut_from_bytes ( bytes) . ok ( )
5454}
5555pub fn as_bytes_mut < T : Castable > ( buffer : & mut [ T ] ) -> & mut [ u8 ] {
5656 buffer. as_mut_bytes ( )
You can’t perform that action at this time.
0 commit comments