File tree 1 file changed +2
-9
lines changed
1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -889,7 +889,7 @@ Returns:
889
889
890
890
The index of the first occurance of `needle`, or -1 if not found.
891
891
892
- FIXME: UTF-8
892
+ FIXME: return an option<char position uint> instead
893
893
*/
894
894
fn find ( haystack : str , needle : str ) -> int {
895
895
let haystack_len: int = len_bytes ( haystack) as int ;
@@ -1003,7 +1003,6 @@ fn is_whitespace(s: str) -> bool {
1003
1003
// Function: len_bytes
1004
1004
//
1005
1005
// Returns the string length in bytes
1006
- // (Synonym: byte_len)
1007
1006
pure fn len_bytes ( s : str ) -> uint unsafe {
1008
1007
as_bytes ( s) { |v|
1009
1008
let vlen = vec:: len ( v) ;
@@ -1013,22 +1012,16 @@ pure fn len_bytes(s: str) -> uint unsafe {
1013
1012
}
1014
1013
}
1015
1014
1016
- // FIXME: remove
1017
- pure fn byte_len ( s : str ) -> uint unsafe { len_bytes ( s) }
1018
-
1019
1015
// Function: len
1020
1016
//
1021
1017
// String length or size in characters.
1022
- // (Synonyms : len_chars, char_len )
1018
+ // (Synonym : len_chars)
1023
1019
fn len ( s : str ) -> uint {
1024
1020
substr_len_chars ( s, 0 u, len_bytes ( s) )
1025
1021
}
1026
1022
1027
1023
fn len_chars ( s : str ) -> uint { len ( s) }
1028
1024
1029
- // FIXME: remove
1030
- fn char_len ( s : str ) -> uint { len ( s) }
1031
-
1032
1025
/*
1033
1026
Section: Misc
1034
1027
*/
You can’t perform that action at this time.
0 commit comments