about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2014-10-08 17:33:02 -0700
committerBrian Anderson <banderson@mozilla.com>2014-11-21 13:17:09 -0800
commit0150fa4b1b3e30b1f763905bd1af2d2ccd73c47e (patch)
tree07115d546445ccc1c0636a03444e9810bc743d89
parentacb5fefd6d9933b345873355c2c0100184c74727 (diff)
downloadrust-0150fa4b1b3e30b1f763905bd1af2d2ccd73c47e.tar.gz
rust-0150fa4b1b3e30b1f763905bd1af2d2ccd73c47e.zip
core: Rename Char::len_utf8_bytes to Char::len_utf8
"bytes" is redundant.

Deprecate the old.
-rw-r--r--src/libcore/char.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libcore/char.rs b/src/libcore/char.rs
index 428a5879b8b..82dc2becf28 100644
--- a/src/libcore/char.rs
+++ b/src/libcore/char.rs
@@ -316,8 +316,13 @@ pub trait Char {
 
     /// Returns the amount of bytes this character would need if encoded in
     /// UTF-8.
+    #[deprecated = "use len_utf8"]
     fn len_utf8_bytes(&self) -> uint;
 
+    /// Returns the amount of bytes this character would need if encoded in
+    /// UTF-8.
+    fn len_utf8(&self) -> uint;
+
     /// Encodes this character as UTF-8 into the provided byte buffer,
     /// and then returns the number of bytes written.
     ///
@@ -352,9 +357,13 @@ impl Char for char {
     fn escape_default(&self, f: |char|) { escape_default(*self, f) }
 
     #[inline]
+    #[deprecated = "use len_utf8"]
     fn len_utf8_bytes(&self) -> uint { len_utf8_bytes(*self) }
 
     #[inline]
+    fn len_utf8(&self) -> uint { len_utf8_bytes(*self) }
+
+    #[inline]
     fn encode_utf8<'a>(&self, dst: &'a mut [u8]) -> Option<uint> {
         // Marked #[inline] to allow llvm optimizing it away
         let code = *self as u32;