Skip to content

Commit

Permalink
core: Rename Char::len_utf8_bytes to Char::len_utf8
Browse files Browse the repository at this point in the history
"bytes" is redundant.

Deprecate the old.
  • Loading branch information
brson committed Nov 21, 2014
1 parent acb5fef commit 0150fa4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/libcore/char.rs
Expand Up @@ -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.
///
Expand Down Expand Up @@ -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<uint> {
// Marked #[inline] to allow llvm optimizing it away
Expand Down

0 comments on commit 0150fa4

Please sign in to comment.