File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -308,7 +308,7 @@ impl Uuid {
308
308
}
309
309
310
310
/// Return an array of 16 octets containing the UUID data
311
- pub fn to_bytes < ' a > ( & ' a self ) -> & ' a [ u8 ] {
311
+ pub fn as_bytes < ' a > ( & ' a self ) -> & ' a [ u8 ] {
312
312
self . bytes . as_slice ( )
313
313
}
314
314
@@ -739,9 +739,9 @@ mod test {
739
739
}
740
740
741
741
#[ test]
742
- fn test_to_bytes ( ) {
742
+ fn test_as_bytes ( ) {
743
743
let u = Uuid :: new_v4 ( ) ;
744
- let ub = u. to_bytes ( ) ;
744
+ let ub = u. as_bytes ( ) ;
745
745
746
746
assert ! ( ub. len( ) == 16 ) ;
747
747
assert ! ( ! ub. iter( ) . all( |& b| b == 0 ) ) ;
@@ -754,7 +754,7 @@ mod test {
754
754
755
755
let u = Uuid :: from_bytes ( b_in. clone ( ) ) . unwrap ( ) ;
756
756
757
- let b_out = u. to_bytes ( ) ;
757
+ let b_out = u. as_bytes ( ) ;
758
758
759
759
assert ! ( b_in == b_out) ;
760
760
}
@@ -779,7 +779,7 @@ mod test {
779
779
fn test_rand_rand ( ) {
780
780
let mut rng = rand:: rng ( ) ;
781
781
let u: ~Uuid = rand:: Rand :: rand ( & mut rng) ;
782
- let ub = u. to_bytes ( ) ;
782
+ let ub = u. as_bytes ( ) ;
783
783
784
784
assert ! ( ub. len( ) == 16 ) ;
785
785
assert ! ( ! ub. iter( ) . all( |& b| b == 0 ) ) ;
You can’t perform that action at this time.
0 commit comments