about summary refs log tree commit diff
path: root/src/libuuid/lib.rs
diff options
context:
space:
mode:
authorErick Tryzelaar <erick.tryzelaar@gmail.com>2014-01-21 17:02:31 -0800
committerErick Tryzelaar <erick.tryzelaar@gmail.com>2014-02-21 19:57:02 -0800
commit8b815104814f814f5fb7d80ba87b63d49ca84e9c (patch)
treeae008a666d8a1adff343ac3831c062c5daa813e3 /src/libuuid/lib.rs
parentd2f73abf10ff72270f36d73e91851511fd1e0580 (diff)
extra: rename Uuid::to_bytes() to as_bytes()
Diffstat (limited to 'src/libuuid/lib.rs')
-rw-r--r--src/libuuid/lib.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libuuid/lib.rs b/src/libuuid/lib.rs
index 5941afb7d75..e3a1f51f73b 100644
--- a/src/libuuid/lib.rs
+++ b/src/libuuid/lib.rs
@@ -308,7 +308,7 @@ impl Uuid {
     }
 
     /// Return an array of 16 octets containing the UUID data
-    pub fn to_bytes<'a>(&'a self) -> &'a [u8] {
+    pub fn as_bytes<'a>(&'a self) -> &'a [u8] {
         self.bytes.as_slice()
     }
 
@@ -739,9 +739,9 @@ mod test {
     }
 
     #[test]
-    fn test_to_bytes() {
+    fn test_as_bytes() {
         let u = Uuid::new_v4();
-        let ub = u.to_bytes();
+        let ub = u.as_bytes();
 
         assert!(ub.len() == 16);
         assert!(! ub.iter().all(|&b| b == 0));
@@ -754,7 +754,7 @@ mod test {
 
         let u = Uuid::from_bytes(b_in.clone()).unwrap();
 
-        let b_out = u.to_bytes();
+        let b_out = u.as_bytes();
 
         assert!(b_in == b_out);
     }
@@ -779,7 +779,7 @@ mod test {
     fn test_rand_rand() {
         let mut rng = rand::rng();
         let u: ~Uuid = rand::Rand::rand(&mut rng);
-        let ub = u.to_bytes();
+        let ub = u.as_bytes();
 
         assert!(ub.len() == 16);
         assert!(! ub.iter().all(|&b| b == 0));