(core::str) make len an alias for len_bytes

This commit is contained in:
Kevin Cantu 2012-02-21 21:12:41 -08:00 committed by Marijn Haverbeke
parent 98447f5236
commit 669ff690fd
1 changed files with 2 additions and 4 deletions

View File

@ -1074,10 +1074,8 @@ pure fn len_bytes(s: str) -> uint unsafe {
// Function: len
//
// String length or size in characters.
// (Synonym: len_chars)
fn len(s: str) -> uint {
substr_len_chars(s, 0u, len_bytes(s))
}
// (Synonym: len_bytes)
fn len(s: str) -> uint { len_bytes(s) }
fn len_chars(s: str) -> uint {
substr_len_chars(s, 0u, len_bytes(s))