From 0150fa4b1b3e30b1f763905bd1af2d2ccd73c47e Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Wed, 8 Oct 2014 17:33:02 -0700 Subject: [PATCH] core: Rename Char::len_utf8_bytes to Char::len_utf8 "bytes" is redundant. Deprecate the old. --- src/libcore/char.rs | 9 +++++++++ 1 file changed, 9 insertions(+) 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,8 +357,12 @@ 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 { // Marked #[inline] to allow llvm optimizing it away