Skip to content

Commit 669ff69

Browse files
killerswanmarijnh
authored andcommitted
(core::str) make len an alias for len_bytes
1 parent 98447f5 commit 669ff69

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/libcore/str.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,10 +1074,8 @@ pure fn len_bytes(s: str) -> uint unsafe {
10741074
// Function: len
10751075
//
10761076
// String length or size in characters.
1077-
// (Synonym: len_chars)
1078-
fn len(s: str) -> uint {
1079-
substr_len_chars(s, 0u, len_bytes(s))
1080-
}
1077+
// (Synonym: len_bytes)
1078+
fn len(s: str) -> uint { len_bytes(s) }
10811079

10821080
fn len_chars(s: str) -> uint {
10831081
substr_len_chars(s, 0u, len_bytes(s))

0 commit comments

Comments
 (0)