Skip to content

Commit 8b81510

Browse files
committed
extra: rename Uuid::to_bytes() to as_bytes()
1 parent d2f73ab commit 8b81510

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/libuuid/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ impl Uuid {
308308
}
309309

310310
/// 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] {
312312
self.bytes.as_slice()
313313
}
314314

@@ -739,9 +739,9 @@ mod test {
739739
}
740740

741741
#[test]
742-
fn test_to_bytes() {
742+
fn test_as_bytes() {
743743
let u = Uuid::new_v4();
744-
let ub = u.to_bytes();
744+
let ub = u.as_bytes();
745745

746746
assert!(ub.len() == 16);
747747
assert!(! ub.iter().all(|&b| b == 0));
@@ -754,7 +754,7 @@ mod test {
754754

755755
let u = Uuid::from_bytes(b_in.clone()).unwrap();
756756

757-
let b_out = u.to_bytes();
757+
let b_out = u.as_bytes();
758758

759759
assert!(b_in == b_out);
760760
}
@@ -779,7 +779,7 @@ mod test {
779779
fn test_rand_rand() {
780780
let mut rng = rand::rng();
781781
let u: ~Uuid = rand::Rand::rand(&mut rng);
782-
let ub = u.to_bytes();
782+
let ub = u.as_bytes();
783783

784784
assert!(ub.len() == 16);
785785
assert!(! ub.iter().all(|&b| b == 0));

0 commit comments

Comments
 (0)