Skip to content

Commit f5e1108

Browse files
committed
(core::str) comments and cleanup
1 parent faa513b commit f5e1108

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/libcore/str.rs

+2-9
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,7 @@ Returns:
889889
890890
The index of the first occurance of `needle`, or -1 if not found.
891891
892-
FIXME: UTF-8
892+
FIXME: return an option<char position uint> instead
893893
*/
894894
fn find(haystack: str, needle: str) -> int {
895895
let haystack_len: int = len_bytes(haystack) as int;
@@ -1003,7 +1003,6 @@ fn is_whitespace(s: str) -> bool {
10031003
// Function: len_bytes
10041004
//
10051005
// Returns the string length in bytes
1006-
// (Synonym: byte_len)
10071006
pure fn len_bytes(s: str) -> uint unsafe {
10081007
as_bytes(s) { |v|
10091008
let vlen = vec::len(v);
@@ -1013,22 +1012,16 @@ pure fn len_bytes(s: str) -> uint unsafe {
10131012
}
10141013
}
10151014

1016-
// FIXME: remove
1017-
pure fn byte_len(s: str) -> uint unsafe { len_bytes(s) }
1018-
10191015
// Function: len
10201016
//
10211017
// String length or size in characters.
1022-
// (Synonyms: len_chars, char_len)
1018+
// (Synonym: len_chars)
10231019
fn len(s: str) -> uint {
10241020
substr_len_chars(s, 0u, len_bytes(s))
10251021
}
10261022

10271023
fn len_chars(s: str) -> uint { len(s) }
10281024

1029-
// FIXME: remove
1030-
fn char_len(s: str) -> uint { len(s) }
1031-
10321025
/*
10331026
Section: Misc
10341027
*/

0 commit comments

Comments
 (0)