about summary refs log tree commit diff
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2014-12-30 13:34:06 +1100
committerHuon Wilson <dbau.pp+github@gmail.com>2015-01-05 12:28:54 +1100
commit8018293e0871645ad266b78864473d82a16d0c0f (patch)
tree8e039cd928ed3e0c9e9d27bfbf4384eb04f87448
parentabdeefdbcc96e0f270a4f74892589e1e6cb9b928 (diff)
downloadrust-8018293e0871645ad266b78864473d82a16d0c0f.tar.gz
rust-8018293e0871645ad266b78864473d82a16d0c0f.zip
Switch encode_utf* to by-value self.
-rw-r--r--src/libcore/char.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libcore/char.rs b/src/libcore/char.rs
index 3423e76ea64..332c002451f 100644
--- a/src/libcore/char.rs
+++ b/src/libcore/char.rs
@@ -183,7 +183,7 @@ pub trait Char {
     /// If the buffer is not large enough, nothing will be written into it
     /// and a `None` will be returned.
     #[unstable = "pending trait organization"]
-    fn encode_utf8(&self, dst: &mut [u8]) -> Option<uint>;
+    fn encode_utf8(self, dst: &mut [u8]) -> Option<uint>;
 
     /// Encodes this character as UTF-16 into the provided `u16` buffer,
     /// and then returns the number of `u16`s written.
@@ -191,7 +191,7 @@ pub trait Char {
     /// If the buffer is not large enough, nothing will be written into it
     /// and a `None` will be returned.
     #[unstable = "pending trait organization"]
-    fn encode_utf16(&self, dst: &mut [u16]) -> Option<uint>;
+    fn encode_utf16(self, dst: &mut [u16]) -> Option<uint>;
 }
 
 #[experimental = "trait is experimental"]
@@ -260,9 +260,9 @@ impl Char for char {
 
     #[inline]
     #[unstable = "pending error conventions, trait organization"]
-    fn encode_utf8<'a>(&self, dst: &'a mut [u8]) -> Option<uint> {
+    fn encode_utf8(self, dst: &mut [u8]) -> Option<uint> {
         // Marked #[inline] to allow llvm optimizing it away
-        let code = *self as u32;
+        let code = self as u32;
         if code < MAX_ONE_B && dst.len() >= 1 {
             dst[0] = code as u8;
             Some(1)
@@ -288,9 +288,9 @@ impl Char for char {
 
     #[inline]
     #[unstable = "pending error conventions, trait organization"]
-    fn encode_utf16(&self, dst: &mut [u16]) -> Option<uint> {
+    fn encode_utf16(self, dst: &mut [u16]) -> Option<uint> {
         // Marked #[inline] to allow llvm optimizing it away
-        let mut ch = *self as u32;
+        let mut ch = self as u32;
         if (ch & 0xFFFF_u32) == ch  && dst.len() >= 1 {
             // The BMP falls through (assuming non-surrogate, as it should)
             dst[0] = ch as u16;